Viewing 4 replies - 1 through 4 (of 4 total)
  • Yes, Im having troub;e getting pagination to work as well.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Are either of you setting your post types to have an archive and then also using the default archive url that WordPress will provide for you at that time?

    Chances are your active theme has some sort of archive.php file that provides pagination links.

    If you’re using these with custom WP_Queries, then it’s a bit of a hairier issue and I know there’s a lot of resources out there to try and get pagination with custom queries working. It’s not something that our plugin does anything with specifically, as it’s very dependent on the theme being used by a user.

    Thread Starter samdz

    (@samdz)

    Hi,

    I am trying to build theme ..

    I don’t understand why the CPT is displayed but when I add fonction
    <?php theme_post_nav(); ?> the pagination is displayed with previous and next CPT but when I click on it, it don’t work, may be problem of loop? it display same page..the first page…

    this is code I used:

    <div id=”ouvrages-cpt”>

    <?php $loop = new WP_Query( array( ‘post_type’ => ‘ouvrages’, ‘posts_per_page’ => 3 ) ); ?>

    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

    <div class=”Publications”>

    • <div id=”detailpublication”>

      <h2><?php the_title(); ?></h2>

      <p><?php the_excerpt(); ?></p>

      </div>

      <div class=”thumbnail”>

      <?php the_post_thumbnail(‘thumbnail’); ?>
      </div>

    • </div>

      <?php endwhile; ?>

      <footer class=”footer”>

      <?php get_template_part( ‘nav’, ‘below-single’ ); ?>

      <?php theme_post_nav(); ?>

      </footer>

      I try to use wp pagenavi too but it display anything.. no pagination.

      I don’t understand why..

      Sam

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I have never heard of or seen theme_post_nav() before, so I’m not sure where that’s coming from.

    See if this link helps at all, and amend as you need https://css-tricks.com/snippets/wordpress/paginate-custom-post-types/

    I also don’t mean to sound dismissive, but https://www.google.com/search?q=pagination+with+custom+wp_query if the first one doesn’t work. Like I said in my last reply, pagination + custom WP_Queries tend to be a bigger pain than they should be, but it’s what we have to deal with and it goes all the way back to WordPress Core, not just CPTUI

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add pagination’ is closed to new replies.