Archived

This topic is now archived and is closed to further replies.

  • 0

Pagination - Still Trying to Figure Out How


Question

Posted · Report post

I would like to paginate my categories, and other listings with page numbers (instead of just the "previous" link.

 

I'm looking at WP-Paginate, but I'm still a bit confused about where to find the php I need to replace and how to do it in the Pagelines framework.  For posts pagination. This is what the WP-Paginate pages say - but I don't see these theme files in Pagelines.

1) Open the theme files where you'd like pagination to be used. Depending on your theme, this may be the loop.php file or the index.php, archive.php and search.php files. The twentyeleven theme places the pagination code in functions.php in the twentyeleven_content_nav() function.

 

2) Replace your existing previous_posts_link() and next_posts_link() code block with the following:

<?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>

 

Catrina was working to help me with this in live chat, but I'm still a bit vague on exactly what steps I need to take this work.   I'm developing a big antiques website - where chronology (previous post / next posts) isn't releavant, I need numbers!  I'd like to make the pagination work on all kinds of pages: searches, categories, view listings, etc.

 

Can you help?

Share this post


Link to post
Share on other sites

9 answers to this question

Posted · Report post

You don't need to add any code it's already in the framework. Sent from my iPad using Tapatalk HD

Share this post


Link to post
Share on other sites

Posted · Report post

Why not use wp page navi plugin? It works without having to edit any files Sent from my iPad using Tapatalk HD

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

Cool, no one has suggested that yet. I'll look for it and give it a try.

Share this post


Link to post
Share on other sites

Posted · Report post

Just searched wordpress - and I am not sure what plugin you mean.  Can you provide the exact name and I'll try it out and let you know how it works!

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks.  Looked at that, and it also looks like it requires editing the php... this is what the instructions say.  And I'm not clear how to do this PHP edit in Pagelines and where these codes to replace are located.

 

"In your theme, you need to find calls to next_posts_link() and previous_posts_link() and replace them.
 

In the Twentyten theme, it looks like this:

<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>

You would replace those two lines with this:


<?php wp_pagenavi(); ?>

For multipart pages, you would look for code like this:

<?php wp_link_pages( ... ); ?>

and replace it with this:
<?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>"

Share this post


Link to post
Share on other sites

Posted · Report post

Just installed, and I love it!  It's clean, it's working beautifully. Thank you so much!  Perhaps let @Catrina know - she was trying to help me yesterday on this in the chat, and made a good effort, but I don't think she'd heard of this solution.  It's perfect.  Thanks again.

Share this post


Link to post
Share on other sites

Posted · Report post

She'll see this post anyway :) Glad your happy with it. Sent from my iPad using Tapatalk HD

Share this post


Link to post
Share on other sites

Posted · Report post

I really appreciate everything both you and Catrina did to help! You are great!

Share this post


Link to post
Share on other sites