Hi I have a Post Object field in Advanced Custom Fields that I want to return multiple posts, ordered by date. I have the custom field data from those posts returning fine, but the Post Objects return in order of the Post ID. I want them to be ordered by the date that the post was published.
<?php $post_objects = get_field('exhibitions');
if( $post_objects ): ?>
 <?php foreach( $post_objects as $post_object): ?>
 <a href="<?php echo get_permalink($post_object->ID); ?>">
 <div style="display: inline-block">
  <? if( get_field( 'title', $post_object->ID) ): ?>
   <em><?php the_field('title', $post_object->ID); ?></em><br>
  <?php endif; ?>
  <? if( get_field( 'dates', $post_object->ID) ): ?>
   <?php the_field('dates', $post_object->ID); ?>
  <?php endif; ?>
 </div>
 </a>
 <br><br>
 <?php endforeach; ?>
<?php endif; ?>
This returns the text custom fields 'title' and 'dates' from each post thats selected in the Post Objects field on the post where this is called.
I want the posts to return here by order of their publish date.
Any ideas?
 
     
     
    