Custom Post Types and Pagination
-
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!
The topic ‘Custom Post Types and Pagination’ is closed to new replies.