Add Extra Fields to WordPress With Advanced Custom Fields {ACF}


{ACF} or Advanced Custom Fields is a plugin for WordPress that allows you to add boxes to your page and post editing screens, and then use those boxes in your theme. That way you can have more boxes then Title, Content, Featured Image, and Excerpt, the possibilities are endless.

Below I have shared a link for a plugin that ADDS A CSS/JS/PHP option to the ACF options!!! This means when you come to a point where you have given yourself another visual editor but don’t know where to put your PHP, give yourself another option like “Include PHP?” that will determine whether to show a WYSiWYG editor, ORRRR a place to put PHP!!! This is huge when it comes to dynamically changing content page to page, post to post. Previously, this was hard to do. You could add a secondary HTML editor, and then allow PHP, but the PHP would often break.This would happen because if you allow PHP in a WYSiWYG editor, it would usually require PHP to be input in the text panel, but WordPress likes to default to the Visual panel, and the PHP would break when toggling between the two tabs, Visual and Text. So, you would have to always check it, or toggle the Text tab and refresh. If you forgot your code was gone, which really sucks. Not to mention its nice to be able to use both Visual and Text editors without any limitations. Luckily, someone made an add-on for {ACF} that allows for a PHP, CSS, or JavaScript field, which can then be used in the <head> or <body> tags of your WordPress theme (just like in the {ACF} documentation, etc). 

Another super handy use of {ACF}, is using {ACF} and the Repeater Field add-on to make sliders with the help of CarouFredsel and a little forethought. I will include a link to both documentations below. Basically, you can code your WordPress theme, like a page template, to include a slider. You do this by creating the typical CarouFredsel markup, usually you would put any number of “slides”, or DIVs with stuff inside, image links, whatever you want, then target it with JavaScript. With {ACF} you can replace the “slides” with the PHP normally used to call an {ACF} field. That way you can have as many or as few “slides” in your slider, with whatever information inside each slide, as you want. The only limitation is the PER SLIDE or PER ITEM animations on slide transition. For example, you set the slider to fade, slide to slide, it would be pretty difficult to make items ease-in, but I am sure it can be done, even dynamically, with the help of {ACF} – you could make custom JavaScript per page to go along with your slider with the previous mentioned add-on, in the link above. I swear this plugin can do anything. Here’s the repeater field add-on, which is EXTREMELY essential to awesome used of {ACF}.. oh yeah and CarouFredsel, which is a super awesome JQuery slider framework, but I will get into that MORE in another post: