Home › Forums › General Issues › Post object & Fields on Blog page › Reply To: Post object & Fields on Blog page
Ah, I’ve sorted it!
I only needed to add the posts page ID to the first call, like this:
<?php $post_object = get_field('prospectus', 674);
if( $post_object ):
// override $post
$post = $post_object;
setup_postdata( $post );
?>
<div class="side-box side-prospectus">
<img src="<?php the_field('image'); ?>" alt="<?php the_title(); ?>">
<h3><?php the_title(); ?></h3>
<p><?php the_field('description'); ?></p>
<?php
$file = get_field('pdf_file');
if( $file ): ?>
<a href="<?php echo $file['url']; ?>" target="blank" class="button small button-icon-right button-icon-download"><?php _e('Download (PDF)','anglocontinental') ?></a>
<?php endif; ?>
</div>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
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.