WordPress.org

Ready to get started?Download WordPress

Forums

Pagination on custom post types not working for search, archive etc... (1 post)

  1. wmboy
    Member
    Posted 2 years ago #

    I've managed to get pagination working for custom post types called 'recipes' with the WP-Paginate plugin using the following code:

    <?php  query_posts( 'post_type=recipes&posts_per_page=6&paged='.$paged );
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    // code goes here
    
    <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?>

    Unfortunately for search.php and taxonomy.php pagination isn't working.

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    // loop through search results
    
    <?php endwhile; ?>	
    
    <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?>

    Is there some way I can add the 'paged' and 'posts_per_page attributes on these pages?

Topic Closed

This topic has been closed to new replies.

About this Topic