Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1207029

    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.

    #1208624

    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

    #1208731

    Worked Perfectly Thanks so much!

    #1208778

    Hi,

    You are welcome! Let us know if you have any other questions or issues :)

    Best regards,
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Displaying Custom Field On Blog Post’ is closed to new replies.