• drkknight32

    (@drkknight32)


    I’m having trouble setting up pagination on my custom post types. Here is the current code I have:

    ` <?php
    $paged=(get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts( ‘strict_type=1&post_type=articles&showposts=1&paged=’.$paged) ?>
    <?php if ( have_posts() ) : ?>
    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( ‘content-simple’, get_post_format() ); ?>
    <?php endwhile; ?>
    <?php next_posts_link(); ?>
    <?php previous_posts_link(); ?>
    <?php else : ?>
    <?php endif; // end have_posts() check ?>`

    Everything seems to function properly until I get to page 2. Page 2 just gives me an error.

    I think part of my problem is that I’m using query_posts, but I’m having trouble figuring out how to get rid of it. I’m currently running queries for four different post types on the front page. They’re all separated by tabs.

    Any ideas? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • vtxyzzy

    (@vtxyzzy)

    I think the problem may be that you have multiple queries. If the paged query var is set, which query does it apply to?

    Thread Starter drkknight32

    (@drkknight32)

    Hm I guess you’re right. I don’t want to remove all of the queries I have on the front page though. I like the way the tabbed content works.

    I suppose I can link directly to the section: website.com/reviews

    And place the pagination on that page where it’s the only query available.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Post Types and Pagination’ is closed to new replies.