Creating a post object field

<?php $postObjects = get_field('post_objects'); if($postObjects){ ?> <h3 class="section-title widget-title">THIS IS A NEWS ITEM ABOUT…</h3> <?php foreach($postObjects as $post){ setup_postdata($post); ?> <div> <div class="post"> <div class="mediaholder"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail('full'); ?> </a> </div> <div class="detailholder"> <h4 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> </div> </div> </div> <?php } wp_reset_postdata(); }// IMPORTANT - reset the $post object so the rest of the page works correctly ?>
Recent Posts
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt