• Resolved sodypop

    (@sodypop)


    Hey guys, i am having a pagination issue and it’s something that is probably really easy, i am just not finding the answer. on my main page i am limiting the post display to just the news category, however, it is paginating for all posts no matter the category, so on some pages i have no content showing. here is my code:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php if ( is_page() ) { ?>
    <?php the_content(); ?>
    <?php } else { ?>
    <?php if (in_category('4') && is_home() ) continue; ?>
    <h1><?php the_date(); ?> | <?php the_title(); ?></h1>
    <?php the_content(); ?>
    <?php } ?>
    <?php endwhile; else: ?>
    Sorry, no posts matched your criteria.
    
    <?php endif; ?>
    
    <?php if(is_category()) { wp_page_numbers(); } ?>
    <?php if(is_home()) { wp_page_numbers(); } ?>

    so basically, i only want the main page (home) to paginate stuff from the category “news” (id 1). what am i missing?
    where did it all go wrong?!!

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘yet another pagination question’ is closed to new replies.