Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display older post first

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?

like image 510
john share this Avatar asked Oct 06 '22 04:10

john share this


1 Answers

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).

like image 125
JoJo Avatar answered Oct 11 '22 03:10

JoJo