Advanced Custom Fields is my essential go to WordPress plugin. It’s the first, and sometimes only, plugin I install when developing a theme for clients. ACF fills in a lot of short comings that WordPress has as a CMS. It gives you the ability to create extremely customizable custom fields that you can assign exactly where to appear. For example, if you have a field that is only specific to a certain template you can assign that field to only show up when that template is selected.
###Keep code out of the page/post editor We’re all guilty of plopping in code that handles layout in the WP post editor. Of course this can get a bit sketchy and the client can easily turn your beautiful perfect design into a mess. ACF makes it much easier to separate the content from your HTML and CSS. No more <div>’s and <span>’s sitting in your post editor.
ACF is free, however, there are a few pay add-ons. The repeater field is my favorite that I use on nearly every project. It’s perfect for creating repeatable entries like tabular data. You define what sort of content the columns will hold and can then add as many rows as needed. Elliot Condon, the plugin developer, has a nice tutorial on creating a custom image slider you can find here.
Here’s a simple example of something I set up recently with ACF. The client wanted to be able to choose and upload a header photo for each page of the site. In addition it needed to do the following:
- Default to a general default picture if no header photo is chosen for a page.
- For subpages/child pages the photo should default to that pages parent header photo.
All I had to do was create an image field (in the example below the field name is “masthead”) and use the following code in the template:
Pretty neat stuff - check out more uses and examples at advancedcustomfields.com.