This code enables you to use custom fields including ACF fields outside the loop in any archive page type template. You can also display the content from a custom Wysiwyg Editor added to your archive template in any hook position outside the content area and loop.
In this example, the contents from the custom Wysiwyg Editor is printed after the pagination on the archive page :
You can use this code to display any type of content from any type of WordPress or plugin specific ( like ACF ) custom fields in any WordPress or Genesis hook position outside the loop on any archive page type.
Demo Video #
Shows the ACF Wysiwyg Editor content displaying after the loop using the
genesis_after_loop hook on the category archive page.
Tested using the Genesis Sample child theme by StudioPress however will work in any Genesis child theme using Genesis, WordPress or plugin specific fields including ACF
Installation Steps #
There’s 2 steps :
Step 1 – Upload the file named archive.php to your child theme folder.
Step 2 – Name the file according to the WordPress Template Hierarchy so it loads on the archive pages you are targeting with custom field content. Or, you can take the code snippet and use it in your functions file with a conditional tag.Subscribe for new Genesis Tutorials