WordPress.org

Ready to get started?Download WordPress

Forums

Can't paginate custom post type on static home page (1 post)

  1. popstalin
    Member
    Posted 1 year ago #

    I've got a static home page with a wp_query for custom post type posts that need to be paginated. I'm using a page builder plugin to build the rest of the page.

    I'm using the following code but the pagination isn't working and I can't figure out why:

    <?php
    $paged = get_query_var( 'paged' )?get_query_var( 'paged' ):1;
    $home_num = '1';
    query_posts( 'post_type=party_theme_post&posts_per_page='.$home_num.'&paged='.$paged);
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <!-- MY LOOP STUFF -->

    <?php endwhile; ?>
    <?php wp_pagenavi(); ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    When I hover over the pagination, I get the link for the second page but it doesn't go to the second page, just reloads the home page.

    I've tried following several tutorials, looked through stack exchange, used suggestions from this forum and nothing I've done (and I've used probably close to 10 different examples) will get this working and I'm stumped. Any help would be greatly appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic