Php 先显示较旧的帖子

Php 先显示较旧的帖子,php,html,wordpress,Php,Html,Wordpress,我正在尝试先在wordpress中显示较旧的帖子: 我正在使用此代码获取当前类别的帖子列表: <ul id="submenu_productos" class="clearfix"> <?php $IDOutsideLoop = $post->ID; while( have_posts() ) { the_post(); foreach( ( get_the_category() )

我正在尝试先在wordpress中显示较旧的帖子:

我正在使用此代码获取当前类别的帖子列表:

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

如果我将
“&order=desc&”
更改为
“&order=ASC&”
,它仍然以相同的方式保留顺序。我做错了什么?

您是否碰巧使用了PostTypesOrder插件?有一个覆盖排序的设置(自动排序排序选项)。

您不应该按日期而不是标题排序吗?我也更改了。仍然显示了sametry this
orderby=modified
,只是想看看您使用的变量是否错误。最后我建议您试试哦,是的,就是这样!哈哈,谢谢。现在的问题是,当我打开用最新帖子打开的页面时,它会先给我安排旧帖子的列表。我怎样才能覆盖它?