changing post order in widget
-
i’m using a PHP Code widget to list upcoming events on my homepage. how do i change the order in which they appear? current the most recent post appears at the top, but i want to reverse it so the most recent post appears at the bottom. how do i do this? thanks in advance!
<?php //display 5 posts for category ID 3 $taxonomy = 'category'; $taxargs ='include=3'; $terms = get_terms( $taxonomy, $taxargs ); foreach( $terms as $term ) { $args=array( 'category__in' => array($term->term_id), 'showposts'=> 5, 'caller_get_posts'=>1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo ''; while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php endwhile; } //if ($my_query) wp_reset_query(); // Restore global post data stomped by the_post(). } //foreach ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘changing post order in widget’ is closed to new replies.