Answer the question
In order to leave comments, you need to log in
Issue with sorting asc in wp_query/query_posts in WordPress. What could be the problem?
This is how I post:
<? foreach (query_posts("cat=" . $value->cat_ID . '&orderby=title&order=ASC') as $post):
Answer the question
In order to leave comments, you need to log in
query_posts() is for WordPress itself and should be used to modify the main WordPress Loop, if you need to create another loop then use get_posts() or WP_Query.
$args = array(
'cat' => $value->cat_ID,
'orderby' => 'title',
'order' => 'ASC',
'posts_per_page' => 3
);
$lastposts = get_posts( $args );
foreach( $lastposts as $post ){
}
wp_reset_postdata();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question