Jump to content
wendyweb

Pagination - Still Trying to Figure Out How

Recommended Posts

wendyweb    1
wendyweb

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

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

  • Like 1

Share this post


Link to post
Share on other sites
wendyweb    1
wendyweb

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

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

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

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

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

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

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • Perry
      By Perry+
      Hi,
      I've added the Post/Page pagination section to the bottom of the blog category page on the dev site here (see screenshot): http://dianef.sandboxes.online/category/intention-and-invention-blog/ but it is giving me the message "Post/Page Pagination is hidden or returned no output", and when viewing the page in another browser, I see nothing.
      Does anyone have an idea why this might be?
       
      Your help is much appreciated in advance.
       
      Thank you,
      Perry

    • John Olsson
      By John Olsson+
      Hi, I wonder how I can edit the function pl_pagination in  function.php located plugins > pl-platform > engine > lib without editing the core-file, that will be overwritten from time to time.
      When I place the same code in my function.php located in my child theme, it just gets error.
      What the practice here, to edit that function, I want to replace for ex. "Next Entries" and the arrow to something else.
      This is what the original code looks like:
      /** * * Pagination Function * * @package PageLines Platform 5 * @subpackage Functions Library * @since 5 * * Single posts need to use next_post_link() * Archives can use next_posts_link() * */ function pl_pagination() { if ( function_exists( 'wp_pagenavi' ) ) : wp_pagenavi(); else : ?> <ul class="pl-pager page-nav-default fix"> <?php if( is_single() && ! is_page() ) { printf( '<li class="previous previous-entries">%s</li>', get_previous_post_link( '%link' ) ); printf( '<li class="next next-entries">%s</li>', get_next_post_link( '%link' ) ); } else { printf( '<li class="previous previous-entries">%s</li>', get_previous_posts_link( __( '&larr; Föregående','pl-platform' ) ) ); printf( '<li class="next next-entries">%s</li>', get_next_posts_link( __( 'Nästa &rarr;','pl-platform' ) ) ); } ?> </ul> <?php endif; } // As a callback with nav args associated function pl_menu_callback( $args ) { pl_menu_fallback( $args['menu_class'] ); } function pl_menu_fallback( $class = '', $limit = 5 ) { $pages_out = pl_page_list( $limit ); printf( '<ul class="%s">%s</ul>', $class, $pages_out ); } function get_pl_nav_default( $args ) { $limit = ( isset( $args['limit'] ) ) ? $args['limit'] : 6; $pages_out = pl_page_list( $limit ); return sprintf( '<ul class="%s">%s</ul>', $args['menu_class'], $pages_out ); }  
    • MissT
      By MissT+
      Hi there, does PowerLoop work with the pagelines page / post pagination section?
      All I want to display a grid of 2 columns of posts using PowerLoop and add in pagination after say 10 posts - is this possible?  I've added the page/ posts pagination section and it says 'returned no output'. As a test Powerloop is set to show 3 posts - which it does but there are no page links to see the remaining posts - there are several more than 3.
      Many thanks in advance.
    • Particle
      By Particle
      There doesn't seem to be any pagination on the DMS Framework theme blog, or perhaps I'm missing something simple.
       
      I thought there may be an issue with the site I'm working on, but then I checked the demo site here and there is no pagination (http://themes.pagelines.com/dms/blog/). Maybe that's just all the posts there are.
       
      On my site, however, there are many more posts than are being displayed. Is there a way to turn on pagination that I'm missing?
       
      Wordpress 4.2
      Pagelines DMS Version: 2.1.9.3
       
      Any suggestions for me? Thanks!
    • rpacker
      By rpacker
      I just realized that on my individual blog post pages, the pagination is not showing up. it used to indicate the previous and next "name" of the blog post. I am not sure when this happened but any ideas? It's definitely activiated.
       
      Here is the most recent post:
      http://www.randallpacker.com/strategically-wrong/
       
      Thank you!
×