Answers for "custom taxonomy pagination 404"

CSS
0

custom taxonomy pagination 404

function modify_product_cat_query( $query ) {
  if (!is_admin() && $query->is_tax("product_cat")){
       $query->set('posts_per_page', 2);
  }
}
add_action( 'pre_get_posts', 'modify_product_cat_query' );
Posted by: Guest on June-03-2021

Browse Popular Code Answers by Language