wordpress - Pagination not working properly with Jetpack Infinite Scroll -
on homepage, using action pre_get_posts , filter infinite_scroll_query_args update query 2 post type.  infinite scroll doesn't work , active 8 times. correct 48 times.
i did tests , understand function getting pagination custom post type, ignoring second.
add_action( 'pre_get_posts', 'function_pre_post' );    function function_pre_post( $query ) {      if ( $query->is_main_query() && $query->is_home() ) {          $query->set( 'post_type', array( 'post', 'critica' ) );      }  }    function jetpack_infinite_scroll_query_args( $args ) {      $args['post_type']   = array( 'post', 'critica' );      return $args;  }  add_filter( 'infinite_scroll_query_args', 'jetpack_infinite_scroll_query_args', 100 ); 
 
Comments
Post a Comment