Sort Most Liked Posts in custom query?
-
Hi. No doubt this is the best like/unlike plugin and I like it a lot. But I’m having trouble implementing the sort feature in my custom query and I’ll appreciate any help.
This my default custom query:
$heroes_query = new WP_Query( array( 'posts_per_page' => 3, 'post_type' => 'heroes', 'order' => 'DESC' ) );
And this is what I tried and no luck:
$heroes_query = new WP_Query( array( $post__in = wp_ulike_get_popular_items_ids(array( 'type' => 'post', 'status' => 'like', 'period' => 'all' )), 'posts_per_page' => 3, 'post_type' => 'heroes', 'post__in' => $post__in, 'orderby' => 'post__in', 'order' => 'DESC' ) );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Sort Most Liked Posts in custom query?’ is closed to new replies.