Custom fields not displaying
-
I’ve installed the ACF plugin and created an field group with two fields: one text field and one image field. I’ve named the fields ad_1 and ad_2 respectively and used <?php the_field(‘ad_1’); ?> and <?php the_field(‘ad_2’); ?> within header.php (after the opening body tag) to display the fields, yet none of the fields display. I also tried it in single.php, nothing.
I noticed in the Getting started page, it says “Once you have created a field group and saved field data to a $post object, you will need to use PHP code to display that data in your theme.”
What does “saved field data to a $post_object” mean? Am I missing a step here? Also, am I limited in where I can use the_field? Does it have to be in the loop or can it be anywhere in the body tag?
I’m going nuts trying to figure this out. Appreciate and help!
https://www.ads-software.com/extend/plugins/advanced-custom-fields/
- The topic ‘Custom fields not displaying’ is closed to new replies.