Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 65
5 votes
Accepted

How to return results of a get_posts() in explicitly defined order

list); // Set menu_order according to the list foreach ($query->posts as &$post) { if (isset($map[$post->ID])) { $post->menu_order = $map[$post->ID]; } } } // Sort … -1 : 1; } These will allow us to set the menu_order property based on our own list, and then sort the posts in a query object based on that. …
Dougal Campbell's user avatar
0 votes

How to return results of a get_posts() in explicitly defined order

How about just clearing the orderby with a filter? Right before you query your posts, put in: add_filter('posts_orderby', '__return_false'); Then, after your loop is done: remove_filter('posts_ord …
Dougal Campbell's user avatar