WordPress.org

Ready to get started?Download WordPress

Forums

WP-Paginate
No previous or next links? (5 posts)

  1. dcloud
    Member
    Posted 4 years ago #

    Seems like a nice plugin, except I was looking at your installation page and I don't have any 'previous_posts_link()' or 'next_posts_link()' codes in either of my index.php, archive.php or search.php files.

    Any ideas how I would implement it?

    Thanks.

    http://wordpress.org/extend/plugins/wp-paginate/

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    find the line with endwhile; of the wordpress loop in your templates, and tr to add the plugin code after that line.

  3. Eric Martin
    Member
    Plugin Author

    Posted 3 years ago #

    If you don't have those functions, how are you currently accessing other pages of posts?

    Either way, you can just drop the wp_paginate() function in your theme, wherever you want the pagination links to be displayed:

    <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?>
  4. dcloud
    Member
    Posted 3 years ago #

    The theme I'm using (2010 Weaver) has navigation links at the top and bottom of the pages. They are referred to in the code as "nav-prev" and "nav-next". They're not very attractive so I was looking for an alternative.

    I was actually looking for a way to display my weekly comics using "next" and "previous" links, but I don't think this will work for that. Appreciate the comments, though.

    Thanks.

  5. Eric Martin
    Member
    Plugin Author

    Posted 3 years ago #

    With WP 3.0, the updates now are in loop.php. For example, you'd need to change:

    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
    	<div id="nav-above" class="navigation">
    		<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
    	</div><!-- #nav-above -->
    <?php endif; ?>

    with the code mentioned in my previous post.

    That's if you want numbered pagination. If you want previous and next, just modify the text that is displayed in the default code mentioned above.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic