Infinite Scroll and custom queries
-
Can IS handle these properly?
I change the order of my front page posts via:
add_filter( 'pre_get_posts', 'custom_query_order' ); function custom_query_order( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'meta_key', 'post_views_count' ); $query->set( 'orderby', 'meta_value_num' ); $query->set( 'order', 'DESC' ); } return $query; }
This works fine locally but on live, it repeats posts and excludes some.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Infinite Scroll and custom queries’ is closed to new replies.