Home Forums General Issues How to order by date field Reply To: How to order by date field

  • Will this work with get_posts as well? I have a similar issue what I want to display all the posts with the category “event” and I want to order them based on Advanced custom field called event_date. Here is how I want to display each post:

                <div class="home-post-area">
                    <div class="home-post-image">
                    	<?php the_post_thumbnail('', array('class' => 'img-responsive')); ?>
                      <div class="home-post-image-overlay">
                        <h3><?php the_field('event_date'); ?> <?php the_field('event_price'); ?></h3>
                        <h4><?php the_title();?></h4>
                    <div class="home-post-content">
                    	<?php the_excerpt();?>
                    <p><a href="<?php the_permalink() ?>"><atrong>>> MORE</atrong></a></p>