2012-02-08 29 views
0

我現在有從電視節目爲特色樂隊演奏的情節,所以,比如我有:排序標題不考慮「的」在WordPress的(wp_query)

  • 白鯨
  • 花花公子沃霍爾
  • The Kooks的

我wp_query看起來是這樣的:

$loop = new WP_Query(array('post_type' => 'episodio', 'cat' => '9', 'posts_per_page' => 90, 'orderby' => 'title','order' => 'ASC' )); 

但我要命令他們這樣的,按字母順序排列,而不考慮 '的':

  • 花花公子沃霍爾
  • The Kooks的
  • 白鯨

有很多的記錄在數據庫中,因此將所有內容都放入數組並將其刪除,刪除'the',重新排序然後再遍歷數組以顯示數據並不實用和/或有效。

這是可能在WP?也許通過過濾器?

非常感謝! :)

+0

上表創建另一列與帖擦洗,並返回基於該列 – chucksmash 2012-02-08 23:25:21

+0

的排序這是我落得這樣做,非常感謝! :) – Alekz 2012-05-10 22:46:40

回答

0
$loop = new WP_Query(array('post_type' => 'episodio', 'cat' => '9', 'posts_per_page' => 90, 'orderby' => 'title','order' => 'DESC' )); 
you will get result post title descending of category 9.