orderby and order with category__and
-
Hello, I have looked in the forum possible solutions, but I’ve applied work.
I’m making a page, and I need to order some posts belonging to two specific categories, for this, I looked around, and I have to use the category__and. So much perfect.
The problem is that if I use the post category__and not sorted from newest to oldest, it is sorted by date of creation, the first post created the first and last end.
code used
NOTE: Infocus on the subject. They say to ask here:
https://mysitemyway.com/support/topic/blog_list-order#post-110728CATEGORY__IN = WORK:
if( trim( $pagination ) == 'true' ) { $paged = mysite_get_page_query(); $blog_query->query(array( 'post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'post', 'posts_per_page' => $showposts, 'paged' => $paged, 'offset' => $offset, 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC', )); } else { $blog_query->query(array( 'post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'post', 'showposts' => $showposts, 'nopaging' => 0, 'offset' => $offset, 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC', )); }
CATEGORY__AND = NOT WORK
if( trim( $pagination ) == 'true' ) { $paged = mysite_get_page_query(); $blog_query->query(array( 'post__in' => $post_in, 'category__and' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'post', 'posts_per_page' => $showposts, 'paged' => $paged, 'offset' => $offset, 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC', )); } else { $blog_query->query(array( 'post__in' => $post_in, 'category__and' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'post', 'showposts' => $showposts, 'nopaging' => 0, 'offset' => $offset, 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC', )); }
If I use category__in, all right, if I use category__and, not working ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘orderby and order with category__and’ is closed to new replies.