WP Paging

2010-01-16 @ 14:47

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.
RSS-feed for comments

75 replys to “WP Paging”

  • ice »
    2011-01-22 @ 6:41 f m

    Good and great beautiful plugin

    refer
    Add to your theme, after the loop or between the endwhile and else.

    i don’t know what file , can i put this code on it.

    index.php right!

    Reply
  • sajjad »
    2011-02-03 @ 10:02 f m

    this plugine is best for page number …
    tanQ

    Reply
  • Enrico
    2011-02-08 @ 9:44 e m

    Hi,
    This is a very good plugin, I’d like to use this, though I’m kinda bit slow on this. How do I use this after placing on the right place? I wanted this to work only on a specific category in wp. And after placing the code after the endwhile it shows numbers more than the posts I have and clicking on the number doesn’t do anything but kept showing the same post. Can anybody help?

    Many Thanks!

    Reply
  • Techmec » Die 10 besten Wordpress Plugins! »
    2011-02-09 @ 1:29 e m

    [...] WP-Paging Mit diesen Plugin lässt sich kinderleicht eine tolle Seitenanzeige [...]

    Reply
  • Lucian Alex »
    2011-02-10 @ 11:49 f m

    10x for the plugin, really awsome.

    i xanr to get rid of this ” [separator] ”
    how can i do it?

    Reply
  • Lucian Alex »
    2011-02-10 @ 11:50 f m

    ok, not showing, it’s the bullet separator
    ”page-numbers dots”>

    Reply
  • Jacob V
    2011-02-11 @ 11:02 f m

    Wow! This one is sweet!

    Totally easy for newbies to customize the design and language, and flexible enough for pros to change the style.

    Just perfect!

    Reply
  • world »
    2011-02-24 @ 12:57 f m

    I have a problem!
    My theme is twenty ten, i have tried to paste:

    in every *.php file after the loop or befeor and after
    endwhile but nothing happened!
    Can somebody tell me where is my mistake … where to paste this code and rune this plug-in
    Regards

    Reply
  • world »
    2011-02-24 @ 7:19 e m

    greate plug in! i have tryied several times to install it but it didn`t work! i paste the required code in diferent *.php documents like index.php, page.php, author.php, header.php …. and still nothing!
    My theme is twenty ten … pleas help

    Reply
  • Anand »
    2011-02-28 @ 6:17 f m

    i am using this plug in in my current working site.
    Its working very fine in mozilla not working in IE
    Plz send any solution for that

    woking:
    http://teluguone.com/vinodam/?category_name=cartoons

    but when i click the next page like :
    http://teluguone.com/vinodam/?category_name=cartoons&paged=2
    in IE
    displays only back gorund color.
    Plz send any solution for this
    ThanQ

    Reply
  • Webowner
    2011-03-03 @ 1:51 f m

    Hello, I own a web business and am using your wonderful plug-in. Can you please tell me how to get it to appear on every blog page, as it only seems to show up on the main blog.
    I have a number of different blog posting by categories.
    Also, how do you center the whole page id’s ?

    It has been installed fine and works well. I would appreciate your reply asap.
    Many thanks.

    Reply
  • shelley »
    2011-03-13 @ 1:31 f m

    I have the same issue as @world. I am using he twentyten theme and have tried placing the ”” after the loop and between the endwhile and else in a single.php post template file. it is not working… doesn’t even appear. please help!

    Reply
  • nauman
    2011-03-15 @ 7:10 e m

    Itsnt it strange thing that they didnt even included blog paging in wordpress?
    I dont knwo why its getting popular…!

    Reply
  • parvez
    2011-04-07 @ 4:59 e m

    this is great plugin.it’s working on index and category page .but i m using on page.php then it’s not working, always show fist 10 post where as in url ?page=2 show
    any solution for this.

    Reply
  • Awon »
    2011-06-10 @ 12:19 e m

    In WordPress, Page navigation is so popular. we use it as default or plugin. it works nice, but sometime we face problem when we use query_posts() for selected category post.
    i hope this is a solution for them.
    I found this solution working fine, check this : URL:
    http://raiseitsolutions.com/forum

    Reply
  • Phil »
    2011-07-05 @ 1:26 e m

    Hello
    Your plugin is excellemt.
    I just need for a method thtat numbering starts not on 1 but from a different number related to the erticle.
    Is this possible?

    Reply

Leave a reply