I need to request a certain list of posts in the order I want. I’m getting the posts using:
query_posts('category_name'=>'cases', 'posts_per_page'=>5, 'post__in'=>$_SESSION['sorting'], 'paged'=>$paged);
It works in that I get the posts in the array $_SESSION[‘sorting’] but the problem is that my sorting gets lost even if iI don’t suggest a special orderby field.
Can anyone help me?
post__in doesn’t affect the ordering at all.
You can achieve the order you want by hooking into the ‘posts_orderby’ filter and use MySQL’s FIND_IN_SET() function.