[wp-trac] [WordPress Trac] #9819: Allow order_by=none in query_posts
WordPress Trac
wp-trac at lists.automattic.com
Thu Sep 24 16:34:45 UTC 2009
#9819: Allow order_by=none in query_posts
-------------------------------------+--------------------------------------
Reporter: joostdevalk | Owner: ryan
Type: enhancement | Status: closed
Priority: normal | Milestone: 2.8
Component: Query | Version: 2.8
Severity: normal | Resolution: fixed
Keywords: has-patch tested commit |
-------------------------------------+--------------------------------------
Comment(by michaelh):
Cannot make this work so that it displays posts in the order of 3,2,5,4,1:
query_posts("include=3,2,5,4,1&orderby=none")
But this filter seems to work:
function filter_orderby($orderby = '') {
$orderby = " FIELD(ID, 3, 2, 5, 4, 1)";
return $orderby;
}
add_filter('posts_orderby', 'filter_orderby');
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9819#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list