Tagged: custom fields
I am trying to display custom fields on my blog posts. I am using the Advanced Custom Fields plugin and the code I need to paste is:
<h2><?php the_field(‘go_deeper_publication’); ?></h2>
When I try to paste it into the single.php file, I can only get the custom field to show up outside the box either above the picture or below the share this entry icons. (as it is shown in the example page where it says “Source: The Morning News”). I would like it to display after the last line of the bullet points but still inside the box. But no matter where I paste the code in the single.php file it will not show up anywhere inside of the box.
In addition, I would also like the custom field to display on all blog posts regardless of where the post is displayed, such as on the homepage, the category pages, etc.
What file and where would I need to place the code to get the Custom Field to display after the body of the blog post.
Hey,
Please copy enfold/includes/loop-index.php file and place it inside your child theme inside /includes/ folder. Open the file and find following line
echo '<footer class="entry-footer">';
and add following code right below that line
echo '<h2>';
the_field('go_deeper_publication');
echo '</h2>';
Best regards,
Yigit
Worked Perfectly Thanks so much!