I'm trying to display the older post first in wordpress:
I'm using this code to get the list of post of the current category:
<ul id="submenu_productos" class="clearfix">
<?php
$IDOutsideLoop = $post->ID;
while( have_posts() ) {
the_post();
foreach( ( get_the_category() ) as $category )
$my_query = new WP_Query('category_name=' . $category->category_nicename . '&orderby=date&order=desc&showposts=100');
if( $my_query ) {
while ( $my_query->have_posts() ) {
$my_query->the_post(); ?>
<li<?php print ( is_single() && $IDOutsideLoop == $post->ID ) ? ' class="test"' : ''; ?>>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> |
</li>
<?php
}
}
}
?>
</ul>
if I change "&order=desc&"
to "&order=ASC&"
it still has the order in the same way. what I'm doing wrong here?
Are you by any chance using the Post Types Order plugin? There is a setting for this that overrides the ordering (the auto-sort ordering option).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With