Home › Forums › Front-end Issues › ACF fields not displaying on 'Posts Page' › Reply To: ACF fields not displaying on 'Posts Page'
I have been trying to solve this same issue today so thought I would post my code in case other were having a similar issue
<?php
$slug = get_page_by_path( 'blog' );
if (is_single()) { ?>
<h1><?php echo the_excerpt(); ?></h1>
<?php } elseif (is_home()) { ?>
<h1><?php the_field('page_heading', $slug->ID); ?></h1>
<?php } else { ?>
<h1><?php the_field('page_heading'); ?></h1>
<?php } ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.