DISQUS

DISQUS Hello! Huddled Masses is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Huddled Masses

Joel Bennett's development blog...
Jump to original thread »
Author

Previous, Next links

Started by Jaykul · 9 months ago

I’ve written another plugin for WordPress 1.2, this time to generate the “Next Page” and “Previous Page” links at the top of this page. Actually, you can put them on the top, or on the bottom, or even in the side bar! It works ... Continue reading »

8 comments

  • Neat !

    I have two comments to make: the first is that I had to change the first RewriteRule statement syntax to cope with sub-categories (basically it needs to be able to pass a / in $1), so it now looks like this:

    RewriteRule ^category/(.*)?page/?([0-9]{1,})?/? /index.php?category_name=$1&paged;=$2 [QSA,L]

    and the second is that with the system as it stands, searching isn't so hot. On a search for the letter 'a' (I wanted to make sure the paged limit was hit !) I end up with the following URL for the second page:

    http://my.demo.blog/index.php?s=a&paged;&2

    which isn't so great. I'm not sure yet why the = has become a 2, but so far that's the only real show stopper from taking this plug-in live.

    Thank you very much for making such an easy to use and neat Prev/Next.
  • Aha ! A simple mistake sorts out the extra ampersand - towards the end of the get_pagenum_link function, change the line after the if stristr to read:

    $qstr .= $querystring_separator.$page_querystring.$querystring_equal.$pagenum;


    It's just a typo - there is a global definition for $querystring_equal above this point, but it's never used.
  • You're right. I've corrected those two things, and actually another place where I'd placed $querystring_separator instead of $querystring_equal ... thanks for the feedback. I'll try to remember to test the search and nested categories next time [;-)]

    Man, with all that code in your comment, I'm rethinking my css formatting strategy [:-p]
  • What change would be needed to make it instead of /page1 to end on /, like /page1/?

    TIA!
  • Just to check...
    Where exactly do i put the codes concerning the styles?
  • *David*: I think the only change would be to the next to last line of code (line 86):

    bc[phphtmlsql]. return get_settings('home').$qstr."/";

    *Jerome*: the styles are CSS, so just put them in one of your current style sheets (eg: wp-styles.css)
  • The plugin file is gone or isn't working - can you bring it back?
  • Sorry, I had a problem with it when I installed a nightly release, and I unthinkingly renamed the file instead of just disabling it temporarily [blush]

Add New Comment

Returning? Login