2012-10-26 64 views
5

我想顯示在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&"它仍然以相同的方式排列順序。我在這裏做錯了什麼?

+2

您不應該在日期而不是標題? – CustomX

+0

我也改變了。仍然顯示相同的 –

+0

「&orderby = date&order = asc」 –

回答

4

您是否有機會使用郵政類型訂單插件?有一個覆蓋排序的設置(自動排序排序選項)。

+0

哦,是的,這是它!哈哈謝謝。現在的問題是,它安排我與舊帖子的名單,當我打開它的頁面打開最新的帖子。我怎樣才能覆蓋它? –

+0

我設法做到了,謝謝! –

相關問題