• Blain is my favorite theme, and I use it all the time. Unfortunately I’ve been having some trouble making a paginated archive page for custom post types. I have one called ‘news’, and supposedly I should be able to go to mywebsite.com/news, and an archive page would automatically come up. That gives me a 404 error.

    So, I made a custom template page and have a loop in it that looks like this

    $args = array (
    	'post_type'              => 'news',
    	'pagination'             => true,
    	'posts_per_page'         => '10',
    	'posts_per_archive_page' => '10',
    	'order'                  => 'DESC',
    	'orderby'                => 'date',
    );

    After the loop, I add:

    <?php blain_content_nav( 'nav-below' ); ?>

    It pulls the first 10 news posts, but there is no pagination at the bottom.

    Can you help me at all? How can I make the regular archive work? If that’s impossible, how can I make the custom template file work?

    Thank you very much!!

Viewing 1 replies (of 1 total)
  • Thread Starter aronsamma

    (@aronsamma)

    OK, I figured some of it out. In my custom template, I used $query as my argument variable, but Blain ONLY accepts $wp_query, like so:

    $wp_query = new WP_Query( $args );

    Now the pagination appears, and looks right, but it doesn’t actually work if I click on one of the other pages yet. I’ll update if I get it figured out.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Pagination for custom post types’ is closed to new replies.