blog posts sorting doesnt work while using get_query_var

I’m trying to show the latest posts using the get_query_var function. The function filters the posts according to their category.
When I’m displaying the posts on the page they appear unsorted although I’ve added the

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
'category__in'=>array( $cat),
'order' => ASC,
'caller_get_posts' => 1,
'paged'=>$paged,
'orderby' => date,
);
query_posts($args);

How can I sort properly?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

If something unexpected happens between query_posts() and get_post(), it is probably a plugin that hooks into the query and modifies it. Try disabling all plugins to see whether the problem disappears. Re-enable them one by one until you see the problem, that is the plugin that causes it.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x