Support

Account

Home Forums ACF PRO Field not showing on blog post

Solving

Field not showing on blog post

  • Hi

    I’ve got an issue where a field is showing when its near the top of the blog (single.php) template, but if I pace it lower down the page, it doesn’t show.

    I’m using <?php the_field('post_form'); ?> and if I have it above the <?php get_sidebar('blog'); ?> it shows, but not if I put it after and I can’t work out why. Other elements after the blog are showing, but not this?

    Any suggestions to help me debug are appreciated.

    Kind Regards
    Wayne

  • Its this bit in the blog sidebar that seems to causing the issue.

    while ($latestposts->have_posts()) : $latestposts->the_post(); ?>
    <?php the_post_thumbnail( 'small-rectangle', ''); ?>	        	
    <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4>
    <p><?php the_excerpt(); ?></p>
    <hr>
    <?php endwhile; ?>

    If I remove this bit it works. Not sure how to edit this bit though (its a site I inherited, so I didn’t code this bit…

  • Adding <?php wp_reset_postdata(); ?> after <?php endwhile; ?> in the blog sidebar template fixed it.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.