This is going to be a quick tip today. There are times when you may want to use an Advanced Custom Field for development but don’t want it to clutter the admin interface. One scenario that I have run into, which I plan on blogging about in the future, is adding a unique ID to… Continue reading Hiding Advanced Custom Fields in the Admin
Category: WordPress
Using an enqueued file’s modified time to break the browser cache
If you’ve been a web developer for a while you’ve likely uttered the phrase, “Empty your cache,” or “Hold shift and click reload” to a user not seeing some of your newly-published changes. When you tell a client to take a look at some revisions, you want them to see the newest version of the… Continue reading Using an enqueued file’s modified time to break the browser cache
Enqueue Scripts Dynamically
I have often found myself building a website where only one or two pages need some JavaScript functionality. It seems like a waste to load something like a Masonry library on every page when it may never be needed. Fortunately, conditionally loading a JavaScript in WordPress is pretty simple. First, though, if you are not… Continue reading Enqueue Scripts Dynamically
Using Gravity Forms’ Constant Contact Function to Subscribe Users
I recently was working on a project where the client had a Constant Contact account and Gravity Forms installed on their WordPress site. Using Gravity Forms’ add-on for Constant Contact it was easy to subscribe users to Constant Contact lists for those forms created with Gravity Forms. However, the project was also utilizing The Events… Continue reading Using Gravity Forms’ Constant Contact Function to Subscribe Users
Inserting JavaScript with a Shortcode
Have you ever needed to insert a piece of JavaScript into a single post or page? Maybe there is an external contact form from a vendor that you’ve been given a snippet of JavaScript to include? There are a number of ways to do this. You could put a conditional in your template file and… Continue reading Inserting JavaScript with a Shortcode
Adding Post Type and Slug to the Body Classes
When I first started working with WordPress, in order to style things on a particular page, I often would use the page or post’s ID to target the styles for that page. After all, out-of-the-box, WordPress gives you a class on the body tag containing the post type and the ID like postid-455 or page-id-525.… Continue reading Adding Post Type and Slug to the Body Classes
Simple WordPress PlugIn to Replace Excerpt With Full Post
I recently posted my lame joke video mashing together The Andy Griffith with Star Wars. In posting it, the excerpt for the post was showing on my site’s homepage and one had to click through to watch the video. There was nothing much to the text of the post – the only thing of note… Continue reading Simple WordPress PlugIn to Replace Excerpt With Full Post
Troubleshooting the White Screen of Death in WordPress
One question that I see asked a lot in the WordPress Support Forums is what to do when their website simply displays a white screen. This most likely represents a PHP fatal error that stops the server from generating the HTML for the browser to display. How to Find the Problem When PHP has a… Continue reading Troubleshooting the White Screen of Death in WordPress
Dynamically Overriding a Page’s Template
It is easy to override the template for a post or page in WordPress in a few ways. For example, the naming of page template files can be used to override a single page’s template: page-{id}.php page-{slug}.php Or, a page template can be chosen in the Page Attributes section when editing a page: This works great… Continue reading Dynamically Overriding a Page’s Template
Hiding the categories of a post when it is “uncategorized”
If you’ve ever had some posts on your WordPress blog, you will have noticed that the “Uncategorized” category is displayed with a link to an archive of uncategorized posts. The easiest way to solve this, of course, is to categorize every blog post. But, if you don’t want to for some reason, you can use… Continue reading Hiding the categories of a post when it is “uncategorized”