WP Paging

2010-01-16 @ 14:47

Många idag har svårt att betala sina räkningar. Då kan en lösning vara att låna pengar gratis. Ja, du hörde rätt, det är möjligt att göra det första gången. Företagen knyter på så sätt till sig kunder och du slipper ränta och andra avgifter.

The problem

WordPress has no built in paging function with numbers for themes. It’s good for users to know how many posts there are and even go to the last one. It’s good for SEO as well.

The plugin

Unlike many other page navigation plugins, this one is based on a core page number function called paginate_links. WordPress use this function for the page numbers in wp-admin. If it’s good enough to use in WordPress core, it’s good enough for everyone else, right?

There are no paging themes (like WP Page Numbers). Instead you can modify the current style in many ways.

WP Paging styles

WP Paging preview - dark background

In short

  • Birth date: 2009-08-26
  • Last updated: 2009-08-28
  • Version: 1.2
  • Tested with:
  • Requirements: PHP5

Download

  • Download from: devdevote.com
  • Download from: wordpress.org (coming soon)

Options

There are only one theme, but you can change that theme in many ways (about 155 520 possible combinations).

  • Live preview – Click on the page numbers to try it out, right from the admin.
  • Texts – Change all the texts except for the numbers. They will still be numbers.
  • Layout – Change positions and how to display the page numbers.
  • Positions – Change positions of page info and the whole paging navigator, align center included.
  • Side numbers – Change the number count on the sides.
  • Colors – Change colors of background, current background and behind text.
  • CSS3 – You can even add gradients and round corners for those who use modern browsers. Internet Explorer is not one of them.
  • Enable style – You can disable styles if you want to add an own style in your theme instead.
  • Delete settings – If you for some reason need to install this plugin you can delete the saved settings.

Screenshots

The admin settings.

WP Paging settings

Installation

  1. Upload the FOLDER ‘wp-paging’ to /wp-content/plugins/ folder.
  2. Activate the plugin ‘WP Paging’ through the ‘Plugins’ menu in admin.
  3. Add <?php wp_paging(); ?> to your theme, after the loop or between the endwhile and else.
  4. Done!

Go to ‘Settings’ and then ‘WP Paging’ to change your settings.

Changelog

  • 2009-08-28
    • 1.2 – Error reporting where turned on. Now it’s turned off, like it should.
  • 2009-08-27
    • 1.1 – Bugfix – The first number now link to the right place.
  • 2009-08-26
    • 1.0 – Initial release.

Known issues

  • expecting T_OLD_FUNCTION or T_FUNCTION”. I still believe this issue occur because the use of an old PHP version.
  • Version number is wrong. It says 1.0 even on this version.

Possible future features

  • Use Ajax for the live preview.
  • Add multiple saved styles. This can be used for different styles in different categories for examples.
  • Language support with MO / PO-files.
  • single.php support.

Advanced

If you are an advanced user, this might interest you, if not, never mind.

Own styles and CSS

To create an own style, uncheck ”Enable styles” (above) and add your own CSS to your styles.css into your themes folder.

CSS Classes

<ul class="page-numbers">
     <li><a class="page-numbers" href="[url]">[page]</a></li>
     <li><span class="page-numbers current">[current page]</span></li>
     <li><span class="page-numbers dots">[separator]</span></li>
</ul>

Some extra classes are added to the UL element to change its style, but only if ”Enable styles” is checked.

Custom arguments

You can override the default values as well as the settings, by adding arguments with the function, when adding it to your theme.

$args = array(
     'base' => add_query_arg( 'paged', '%#%' ),
     'total' => $wp_query->max_num_pages,
     'current' => $page,
     'prev_next' => false,
     'prev_text' => 'Prev',
     'next_text' => 'Next',
     'end_size' => 1,
     'mid_size' => 2,
     'show_all' => false,
     'type' => 'list',
     'behind_color' => 'dark',
     'page_bkg' => 'bright',
     'current_page_bkg' => 'cyan',
     'enable_rounded' => true,
     'alignment' => 'left',
     'enable_gradients' => true,
     'separator_text' => '...'
);

Example

<?php echo wp_paging('show_all=true&page_bkg=dark'); ?>

Problems with 404 pages (too many page numbers)

Many people seems to have problems with 404 pages with the paging plugins out there. The problem occurs when themes are using an own WP Query object for the loop. WP Paging is clever enough to accept the parameter ”total” where you can set how many pages there are.

Look for this

$my_own_query = new WP_Query();

Remember the string of your theme (like $my_own_query).

Replace

wp_paging();

with

wp_paging('total='.$my_own_query->max_num_pages);

Change the string $my_own_query to the string of your theme.

Contribute

  • Report bugs.
    • Be specific.
    • Tell me your WP version.
    • What did you do?
    • What is your guess?
    • Do you have a fix?
  • Spread the word. Write about WP Paging, link to this site and so on.
  • Add a comment with a link to your website where WP Paging is installed. It’s nice to see how people are use it.
Share
RSS-feed for comments

89 replys to “WP Paging”

  • x600
    2009-08-29 @ 1:20 e m

    Why don’t you upload plugin to official wordpress.org directory? ( http://wordpress.org/extend/plugins/ )? Automatic upgrade would work.
    Anyway, thanks for the plugin. Works great.

    • admin
      2010-01-17 @ 1:21 e m

      Thanks! I have hosting for WP Paging at wordpress.org and I will release it there soon. Then you can upgrade it automatically. I just wanted to present the plugin for a small audience first to get rid of the first bugs, if any.

      • cer-eb
        2010-03-09 @ 5:02 f m

        You are in Beta, it seems, but your approach certainly makes total sense. As described, code-workers will have no trouble installing it, but I am not one of them – and placing the plugin in the wp-dot-org environment means that you will probably get more requests for more detailed ”how-to’s”. Any plans to augment the install instructions before being hit with an avalanche of help-requests??

        I ‘really’ want to use that plugin —

  • joe mark »
    2009-08-29 @ 1:22 e m

    Thanks, your plugin rocks. It is light and doesn’t need any database set up which make it simple and easy to use.

    I use it on my site, the one on my signature.

  • joe mark »
    2009-08-30 @ 1:23 e m

    And it works with WordPress MU and Buddypress too, here’s the link of my other site using the plugin http://piyesta.com/sadyatv.

  • joe mark »
    2009-08-30 @ 1:27 e m

    Thanks too. It is really cool piece of plugin and Im planning to change my other site that uses the other bloated plugin with yours.

    By the way, this is the correct link http://piyesta.com/sadyatv of my WordPress MU-Buddypress site. The link on my previous comment has period that which leads to the error page.

    I will make a review on your plugin soon. Have a great day.

  • Li-An »
    2009-08-31 @ 1:29 e m

    It works nice but I’ve got the same problem as with the other paging plugins: it count more posts than I got (if I click on the last page, I’ve got an 404 error). Well, as it’s a common problem it’s not a bug but if somebody’s got an solution to this problem.

    • admin
      2010-01-17 @ 1:33 e m

      I had the same problem on my blog and I now know how to solve it.

      Look for something like this in your theme:
      $my_own_query = new WP_Query();

      Remember the string of your theme (like $my_own_query).

      Replace
      wp_paging();

      with
      wp_paging(‘total=’.$my_own_query->max_num_pages);

      Change the string ($my_own_query) to the string of your theme. I hope you can understand this. If not, write again.

  • Jehy »
    2009-08-31 @ 1:35 e m

    Very cool plugin, thanks for feedback in my blog.
    Right now I’m already pleasured with your “WP page numbers”, and it doesn’t make sense to change it.

    Certainly, I will use it in my future projects, and I’m going to give it 5\5 on wordpress plugin repository.

    By the way, your blog’s design is cool – I really like informative strict designs where you don’t have to search desperately for the link you need.

    Thanks one more time.
    You can also try some of my plugins here.
    Jehy.

  • Robin des Bonds »
    2009-09-06 @ 2:15 e m

    Hello,
    Thanks for this new plugin.
    I am using it with a freshly installed Panorama Theme, on WP 2.8.4.

    I added in the index.php and it works perfectly.

    However, it does not seem to work when put in single.php, am I doing something wrong ?

    Here’s a ”single page article” for example :
    http://www.oblig.fr/2009/08/titre-participatif-renault/

    I tried 4 positions for the function (I commented saying “wp_paging is called here” when the function was called, you can see them in the HTML), with no success.

    You can see in my code that I even tried to call it before the_content !

    I tried to call it from single.php files belonging to other themes (tried Journalist, iNove, and the default WP there), and the page behaved like it ignored the plugin…

    Am I doing something wrong ? How else could I test ?

    Many thanks,

    Have a nice day.

  • Ryan »
    2009-09-21 @ 2:27 e m

    Love the plugin. Looks great on my site. However, when I click on any of my category pages and navigate to the bottom of the page, it is gone and the original wordpress page navigation is listed. Could you help me solve this problem? I would like to have the WP Paging appear on every page that a user clicks on at my site. Thanks and keep up the great work.

  • Richard Peters »
    2009-09-25 @ 2:28 e m

    I’d love to use the plugin but after inserting the code at the end of the loop in my themes index.php but nothing happens. When you say try putting it between the ENDWHILE and ELSE, how exactly do you mean because if I drop the code in there it breaks the endwhile/else code. I’m not a genius with this stuff but I can get by if talked through things so if you have an idea why it’s not working that would be great. Site is offline (localhost) so I can’t link to it I’m afraid. Using WP 2.8.4 and trying to install on the Studiopress Church theme.

    Thanks

  • Richard Peters »
    2009-09-30 @ 2:33 e m

    Got it going, works perfectly!! Was having a stupid moment and finally noticed I was putting it in the wrong file!!

  • Adrian »
    2009-09-30 @ 2:34 e m

    Apparently, until now, I had this URL format (example):

    http://trendgiveafck.com/street-walk/

    when paging turneed on the site wanted to go to

    http://trendgiveafck.com/street-walk/page/2

    which led to a 404. But if I added “category”:

    http://trendgiveafck.com/category/street-walk/page/2

    I came to the correct page. So, I in the admin panel I went to

    Settings->Permalinks and set the field “Category-base” to “category”

    also checked my hard links in my meny to go to “category/street-walk/” instead of just “street-walk”

    Problem resolved!

    • admin
      2010-01-17 @ 2:37 e m

      Your info might be helpful in the future. Thanks!

    • rizwan »
      2010-04-30 @ 4:27 e m

      thanks!
      Adrian
      i was also facing this problrem abt permalinks.
      nice site.
      http://www.seganta.com/clients/niji/live
      i m working on this site.plz tell me the suggestions that what can i do more on this site?
      thanks

    • rizwan »
      2010-04-30 @ 4:36 e m

      nd plz tell me the solution that who can i display the selected archives recent posts.mean i on the music category page archives funtion just search the post regarding that category post.not display all posts of all the category?
      thanks

  • MadHatter »
    2009-12-12 @ 2:43 e m

    Just had to say THANK YOU SO MUCH for this great plugin. It looks wonderful, and was the only plugin that would add decent page numbers to the theme I use. Unfortunately, my theme has an override which only shows a forward or back arrow at the bottom, and I suppose I’ll leave it there anyway… but your numbers are far easier for my readers to see.

    (By the way, that site isn’t complete yet, I’m in the middle of bringing everything over from another site at the root)

    Thanks again!

  • Brian
    2010-01-10 @ 2:52 e m

    Is there a tweak available to get the page numbers to work on an individual post page?

    Example.. Page 1 of 20 (within a category)

  • sean j »
    2010-01-11 @ 2:54 e m

    Thank you so much for this.

    i have a wordpress theme that i took from a german site. I translated it to English but couldnt work out the paging – there wasnt any.

    I spent a whole day racking my brains then saw this. Im not very good at php stuff.

    My 1st attempts didnt work because i couldnt work out where to put the coding. I tried a basic code on the wp site and it eventually worked. Did the same thing with your code and hey presto.

    It had to go just before the footer code in my index.php.

  • Scott H »
    2010-01-19 @ 5:32 f m

    What an awesome plugin. It worked great the first time putting the code between endwhile and else in my index.php.

    I have had so many problems with navigational plugins. Thank you for this, I ran across this page googling around for help.

    I have the same question as Brian above, How do I get this plugin to show the same navigation on posts. As of now it only shows on my home page and I want it to show on posts.

    Thanks,
    Scott H

  • Jonatha »
    2010-01-25 @ 10:26 e m

    Hi, I’m trying to install this plugin, but no sure exactly where to place the loop. There are many places inside my theme, using ”Affiliate Theme,” to put the loop:

    I am placing between the Endwhile and Else, yet nothing is changing. Does anyone have and ideas? I really appreciate your help!

    Jonathan

  • hbaba »
    2010-03-04 @ 10:57 e m

    Thanks for the Plugin. Cool and easy to use.
    I’m using it on my website but there’s a problem in showing the ”NEXT” button:
    It is appearing before the page numbers.
    Have a look at the actual result:
    http://healthybaba.com/category/healthy-living

  • X-Evolutionist »
    2010-03-12 @ 10:29 e m

    Your plugin sounds great, but it’s not listed on WordPress.org. Let me know when it is listed there, and i will try it. X

  • legend
    2010-04-07 @ 12:14 e m

    how can i add this plugin above footer
    it is appearing below the footer

  • Judie
    2010-04-18 @ 7:27 e m

    Great – worked perfectly on the home page, but like some others, can you explain how to get the same buttons to appear on secondary pages. Thanks!!

  • Steve Malone »
    2010-04-22 @ 11:23 e m

    Hello!
    This plugin looks great. However, I have installed, and activated it, and nothing seems to be happening on my site.

    http://www.plaidmustache.com
    wordpress 2.9.2
    ”benevolence” theme

    could you please advise as to what I could to to use your amazing plugin!?

    • admin »
      2010-04-23 @ 5:55 f m

      As you put it in another post:
      ”nevermind, i didnt follow the last bit of instruction! had to add”

      Thanks for your comment!

  • Wp-Paging (safya navigasyon eklentisi ) - v4.Net Webmaster Forumu »
    2010-05-14 @ 12:03 f m

    […] […]

  • Mark Spivey »
    2010-06-18 @ 3:46 e m

    Do you know how to add nofollow links to the buttons please??

    Thank you!

  • Angelia
    2010-06-24 @ 7:30 e m

    Hi there. Using your plugin and love it. Very nice. Wanted to give you some feedback though. The plugin doesn’t load the CSS file into my header at all. I fixed it by just loading the CSS file directly in my theme, but, thought you might want to know that. Feel free to email if you would like to troubleshoot the specifics for the sake of the plugin~

  • diziizle »
    2010-06-28 @ 10:58 e m

    thankyo man perfect 10/10

  • How to show Page Numbers in WordPress footer navigation? | WordPress Rockers »
    2010-07-10 @ 8:38 e m

    […] WP Paging […]

  • How to show Page Numbers in WordPress footer navigation? | WordPress Rockers »
    2010-07-10 @ 8:38 e m

    […] WP Paging […]

  • Jacob Dunn »
    2010-07-13 @ 8:36 e m

    Good plugin – appreciate the options, and the fact that you’re using the built-in wordpress function.

    One minor issue I’ve caught – you remove a class from the prev link in your modify_first_number function on line 230. Makes it a little difficult to style the prev/next links individually. ;-)

  • neil
    2010-07-19 @ 4:57 e m

    I have installed the plugin and pasted the code into index.php file after but the page numbers just aren’t showing on my blog? Can anybody help me with some suggestions?

    Thanks

  • neil
    2010-07-19 @ 4:58 e m

    Here’s a screen shot to go with my previous post:

    http://screencast.com/t/YjRkODFl

  • cihip »
    2010-07-24 @ 2:06 e m

    WP Paging for thanx.

  • Sammy
    2010-08-03 @ 3:39 f m

    Man your plugin is cool,I want to know how to insert it in one page…Thanks

  • Chris »
    2010-08-06 @ 9:03 f m

    Firstly thanks, this plugin is great and will save me the trouble of creating my own pagination buttons.

    One thing I would like to request / suggest is the option to customise the URL output from the default ‘…/page/#?…’

    I have a site using WP as a cms and I use a specific URL structure. Passing the page as a standard ‘?p=#’ GET parameter would work for me if this is possible please?

  • Sheldon
    2010-09-09 @ 2:52 f m

    Ok i love this plugin but i have one problem. When I added in the links bullets for an list shows up on the P in page 1 of X and by the spacer (…). How can i make the bullets not show up?

  • chad »
    2010-09-12 @ 9:55 f m

    hi guys, anybody know how to change the last page number to the word ”last”? it seems i cant get into the code..ideas will be appreciated..

    Thanks,

    Chad

  • Yeltsin Lima »
    2010-09-21 @ 7:39 f m

    First, I want to say Thanks.

    Them I want to say: MAN, I LOVE YOU…

    Thanks again,
    Yeltsin Lima

  • Maikee »
    2010-09-24 @ 10:04 e m

    Nice Script !
    greets from germany !

  • Elmarie
    2010-09-29 @ 12:58 e m

    This plugin looks nice but I can’t get the paging to work on my custom page. If i click on the next page it goes to /page/2 but it still shows the posts from the first page. Anybody got any ideas?

  • Paginação para temas WordPress com o WP Paging | DicasWP »
    2010-09-30 @ 3:41 e m

    […] instalação é bastante simples, baixe o arquivo do plugin, extraia os arquivos na pasta wp-content/plugins/ do seu WordPress e coloque o […]

  • Jeremy T. »
    2010-10-28 @ 3:50 f m

    I have downloaded and uploaded the Files into my FTP but I don’t see it on the list of Plugins ??

    HELP !

  • Freewomyn »
    2010-11-01 @ 5:09 e m

    Thanks for this plugin. It’s very user friendly.

    I have been able to install this on my home page (www.gloriafeldt.com/heartfeldtblog), but I would also like it to appear on the category index pages, since I am using one of them as a second blog on my site (www.gloriafeldt.com/9ways).

    Where do I need to install the coding so that this shows up on category index pages?

    Thanks!

  • install !? »
    2010-11-08 @ 4:53 e m

    hello

    i have no
    Add after the loop or between the endwhile and else in your theme.

    anywhere in my theme so where to put it !?

    regards

    HHO

  • Serhan
    2010-11-09 @ 10:18 f m

    Thanks a lot for your plugin!

    Regards,

    Serhan

  • How to Install WP Paging | Arif Aceh Dot Com »
    2010-11-13 @ 3:35 e m

    […] There are no paging themes (like WP Page Numbers). Instead you can modify the current style in many ways. please click here […]

  • Rizky Syazuli
    2010-11-14 @ 1:05 e m

    hi, really useful plugin btw :D just have one quick question: does this plugin have some sort of indicator that we can check to see what page we’re on?

    coz i have this intro content that should only be showed on the first page and not the rest.

    thx

  • Taloweb »
    2010-11-15 @ 9:06 e m

    Hi, what about custom post type? I tried but in custom post type section if you go to another page navigation continues on standard post and not on custom post type section…

  • Kooshal »
    2010-11-17 @ 4:58 e m

    In function font_add_css, I’m having to comment these lines for the plugin to work:


    global $wp_query;
    $max_num_pages = $wp_query->max_num_pages;
    /*if($max_num_pages > 1)
    {*/
    echo 'get_style_url('style.css') . '" type="text/css" media="screen" />';
    /*}*/

    Maybe a bug?

  • WordPressにページャーを追加するプラグイン - サツぽろ、ニッキ。 »
    2010-12-30 @ 2:34 f m

    […] 3.WP Paging これはデザインの種類が豊富ですね。 […]

  • John Crandall »
    2011-01-06 @ 1:34 f m

    Hey Jen,

    Is there a way to reverse the numbers?
    Instead of 1 2 3 4 5
    5 4 3 2 1?

    Even if there isn’t, thanks for the great plugin

  • John Crandall »
    2011-01-06 @ 11:11 e m

    ugh i’m so embarrassed. I called you Jen, not Jens. My apologies :(

Leave a reply