Sorting in newest-to-oldest order
-
Hi! I’m happily using this plugin for ages but I’m now trying to do something and having trouble. I’d like to organize my page of “past events” so the most recent is first, and the very oldest at the bottom.
To do so, I’ve employed this code:
<h1 style="margin-bottom: 24px">Events Now Concluded</h1> <?php $events = eo_get_events(array( 'event_end_before'=>'today', 'showpastevents'=>true, //Will be deprecated, but set it to true to play it safe. 'order' => 'DESC', )); if( $events ){ global $post; foreach( $events as $post ){ setup_postdata($post); ?> <a href='<?php the_permalink() ?>'> <h2><?php the_title(); ?></h2></a> <?php eo_get_the_start('jS F Y'); ?> <p><?php the_excerpt(); ?></p> <?php } wp_reset_postdata(); }else{ echo 'No Upcoming Events'; } ?>
…simply adding the
'order' => 'DESC',
parameter.But, whether I use “ASC” or “DESC”, I still get the oldest first.
Am I doing something wrong?
thanks!
adam
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Sorting in newest-to-oldest order’ is closed to new replies.