Often times, a design will call for separate areas within a page to have their own unique styles applied to them. Whether it’s a different background color, font size, or available space, editing those areas can be frustrating when the backend editor does not have those same styles. By default, ACF does not have the […]
This walker class will generate a clean unordered list. It removes the numerous classes added to each list item by the default WordPress but will keep any custom classes that have been added directly via the menus admin.
This is a step by step tutorial on how I was able to get WP-CLI up and running on Mavericks with AMPPS. The biggest issue that you will typically face when installing WP-CLI along side a web host software stack (MAMP, XAMPP, AMPPS) on a Mac is that WP-CLI will want to use the PHP […]
Recently, I needed to check for the existence of several related shortcodes within WordPress. Rather than writing a large if-or statement I came up with this small function that takes in an array of strings and a boolean to determine whether I needed to check for the existence of all the supplied shortcodes or just […]
This function will extend the default get_field function within Advanced Custom Fields to also allow you to: pass in a default value in case none are found fall back to site options (if one exists) pass in the ID of the post to get the field from and then apply the previous actions
The demo plugin can be downloaded here.
Place this snippet of code in your functions.php file or in a plugin and then your admin bar will display the path of the template being currently used:
If you’ve found that particular transients simply will not display in your theme yet they aren’t throwing an error? Check your database for duplicate entries. It is possible when moving a site between servers for a transients to become duplicated within the wp_sitemeta table and this causes the get_site_transient() function to silently fail. Simply go […]
This little script will keep whatever custom field values you have used when you restore a post to a previous version. Currently, WordPress by default will clear those custom fields whenever you try to restore a post to a previous version which can lead to some headaches. Add this bit to your functions.php file to […]
Recently I wanted to update a particular WordPress installation to use something other than the theme’s style.css file as it’s default CSS document. Here is the code to enable that: