WordPress infinite scroll “category” archive.php

$queried_object = get_queried_object();
$offset = $_POST[‘offset’];
$number_of_posts = get_option( “posts_per_page”);
$args = array(“posts_per_page”=>$number_of_posts,”offset”=>$offset, ‘orderby’ => ‘DESC’,’category__in’ => stripcslashes($queried_object->cat_ID),);
$posts = get_posts($args);
query_posts($args); if (have_posts()) : while (have_posts()) : the_post();

get_template_part( ‘template-parts/infinite’, get_post_format() );

endwhile;

endif;

die();

archive.php I can’t shoot the category

Read more here:: WordPress infinite scroll “category” archive.php

Leave a Reply

Your email address will not be published. Required fields are marked *