This is our first public plugin that we put up on the WordPress plugin directory.
What is it?
Instead of using so many page numbers on your post page or having next and previous links, this plugin handles the pagination with a much more organized way. In the name version, you get an admin panel with the ability to change the number of pages that shows, whether you want to show the dropdown or not and also you can choose to show the navigation panel if there is only one page or not.
Screenshots


How to use
All you need to do is upload the plugin to your plugins directory just like any other WordPress plugin. Then you need to add the following line to your single.php for paging your posts and page.php for your paging your pages.
<?php mysinglepages(wp_link_pages(array('before' => '', 'after' => '', 'next_or_number' => 'number','echo' => '0'))); ?>
Pretty much all you need to add is mysinglepages() function around your page links function.
Hi,
I have implemented the pluging on http://delhi-masterplan.com/news-articles/. this is awesome. I was trying to get something like this since long. But I have one issue since I have about 33 pages in it, is there any way to display (page 2 of 33) means current page & total page? It would be really helpful. Thanks
Thank you for your comment. It is definitely something we can implement in the next version of the plugin.
I don’t understand something. In the installation instructions it says put in your post. I did this and it shows 2 pages now… but the same post.
Tell me how to use this correctly please.
I installed the plugin. Then opened single.php and pasted the code in under the content column. It shows only 1 page. There are 50 posts and they’re not linked together. How do I do this?
It does pagination in your post not page your posts into one whole post.
For example, if you have one long post and you put the “” in the middle of the post, you will have two pages in that post.
Hi Admin…
I also not understand. I’m already install plugin. but can’t. I don’t know where need to put This line ”, ‘after’ => ”, ‘next_or_number’ => ‘number’,'echo’ => ’0′))); ?> . Pls can you show step by step with picture. Thanks
In your code look for the line that starts with wp_link_pages(. Now replace that line with the code above in the plugin.
If you don’t have that line in your single.php look for the line that has and after the end of its div “” put that line.
I put already that line at single.php and page.php of my site but still not appear. What should i do again? Pls help me.
In the administration panel of your website check to see if the plug in is disabled when there is only one page.
Also, what kind of a permalink structure are you using?
iI useing that Day and name http://sindecafe.com/2010/02/13/sample-post/
“Always Show Navigation”
In the plugin admin menu, make sure this is always set to “Yes”.
I’m having the same problem. I can’t get anything to show up. I’m running version 2.9.2 . How do I select yes in the administration panel? Thank you for being so dedicated to your work!
Hello Admin…
I changed to “Yes” at Always Show Navigation but still not appear. http://kminsw.fileave.com/sinde.png I’ll try again.
Whats the url of the page?
Hi Admin,
This is my site. thanks
In your single.php put the function right after the following line.
That should work.
I put already in single.php but still can’t. By the way, just now I used Pages plugin on my site that About and Image. When open About and Image, appear [previous 1 next]. Why not function like that on Front page displays? Pls check on my site and help me how should be do again. Thank a lot for your helpful.
I see the plugin is displayed at the wrong spot and that’s why its appearing on the top of the page all the way top. You need to put the function in the right place to see it under the post.
Interesting Blog with a good layout, keep up the good work.
i inserted the line in both.php page and sigle.php and can’t see any page numers, help please
do you have any <!–nextpage–> tags in your post?
i got it, never mind
How did you get it?
Plugin “Number my post pages” ver. 1.2. made my pages:
1 2 3 4 5 6 7 8 9 10 11 12 13 …
How I can made number of pages like this:
01 02 03 04 05 06 06 08 09 10 11 12 13 …
?
I have Wordpres 2.9.2. PHP 4.4.9.
Thank you
On line 241, there is this string $resultsarr[$a]['number'], Replace that with the following, it should do the trick;
str_pad($resultsarr[$a]['number'],2,”0″,STR_PAD_LEFT)
Thank you very much. It works !
I’m really thankful that you created and are sharing this plugin because it’s exactly what I’m looking for. I’m just trying to make it work now.
I have the same issue with it displaying only 1 page when it should list multiple pages. I tried researching but no avail.
My permalinks are structured /year/month/post-title.
I greatly appreciate your help.
Im assuming you have the nextpage tag in your post ? When you put the following function by itself, do you see the page numbers?
wp_link_pages(array(‘before’ => ”, ‘after’ => ”, ‘next_or_number’ => ‘number’,'echo’ => ’0′))
Hello. I really like your plug-in. Just one question.
In the default mode, the dropdown menu appears with the word “Page” above it.
The dropdown also lines up 1 line below the left side. How can I make the word “Page” appear immediately to the left of the dropdown and everything line up nicely on the same line?
I am probably missing the very obvious here.
Do you have float:none or display: block for your select fields in your main stylesheet?
I haven’t checked the css problem yet but noticed something else more important. Any theme I use brings up the following problem:
Page one initially appears when the article is clicked from the home page, but after forwarding through the pages afterwards it will not page back to the first page. It will stop at page 2.
I have to use the default wordpress function that I have included on the top of my page to go to page 1.
Page is on a new line because the select right next to it doesn’t have float:left and its width is set to 100%.
As to No 1 link, it looks like a bug in the code. Ill take a look at it.
hi,
i’m using your plugin for the new look i’m getting ready for my site.
i’m right now checking and validating before uploading the theme, and i’m getting this error related to your plugin… could you help me fix it please?
i think you can find all the info about it on this link:
http://validator.w3.org/check?uri=http://test.layabozi.com/wordpress/category/columns/articles-interviews/article/&charset=(detect+automatically)&doctype=Inline&ss=1&outline=1&group=1&No200=1&st=1&user-agent=W3C_Validator/1.767#line-241
✉
Line 241, column 80: Opening and ending tag mismatch: div line 241 and ul
…ass=”page_info”>Page 1 of 1« Earlier<li class=…
Line 261, column 6: Opening and ending tag mismatch: body line 80 and div
Line 278, column 7: Opening and ending tag mismatch: html line 3 and body
end tag for element X which is not open ✉
The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
If this error occurred in a script section of your document, you should probably read this FAQ entry.
Line 241, column 220: end tag for element “ul” which is not open
…ss=”paginate”>1More Recent»
THANKS!!!!!!!!!!!!!!
Ill do an update on the code and submit it to WordPress directory, you will be able to update the plugin today or tomorrow.
thanks! for that.
now also i’m installing the new look on my site, and i’m also realizing that i don’t get the plugin to show more than “1″ page on the list of pages. as has been mentioned here before. the tag on the php files is ok, and all it’s set right on the plugin settings, as you’ve explained.
would you please help me with this? i need to have the site working for monday :/ sorry for the pressure. :(
Did you make sure your <!--nextpage--> tags inside your posts are placed?
hi! thanks for your reply, and i sorry the late answer, (time difference i guess, i just woke up ) … do i need to add inside every post? and that sounds like will cut the posts in pieces, and i want to number the pages for the roll of posts, so now i’m wondering maybe i made a mistake and that’s what your plugin does, instead of numbering the pages for the loop of posts… i’m confused now.
good sunday for you!
Well the tag initially splits a post into pages, it is part of the WordPress Core functionality and then my plugin shows the page numbers in a more organized way. Normally you would see all the page numbers, so like if you have 100 pages, you’d see the page links from 1 to 100.
hi Ali!
well, it’s good to know i was not mistaken about what your plugin does (pheeew :) )
so, then it should show the numbers of the pages to navigate on the loop, and the loop of categories. but it’s not showing more than 1 page, when i have hundreds of posts, so i should have at least 30 or 40 pages to surf on.
now the tag to split posts, i haven’t used it, i don’t want to do have the posts divided in pages. each post in on page is alright for me.
if u send me your email, i could add u to my users, to check on your plugin. we are ‘under construction’, so unless you are login, u won’t be able to see your plugin in action.
thanks for your attention Ali.
Have a good monday!
Like I said, without the tag you will only have 1 page. The tag is the only way to wordpress has determine where to split your post.
Did you figure out why yet the plug-in will not re-curse back to page 1 yet?
Here is the example:
http://charlesasullivan.ca/196/origen-on-the-gift-of-tongues/2/
Try to go back to page 1. It won’t.
WordPress 2.9.2
I couldn’t recreate the problem on my system. Does the links work fine if you put the following code in your single.php;
wp_link_pages(array(‘before’ => ”, ‘after’ => ”, ‘next_or_number’ => ‘number’,'echo’ => ’0′))
(site not public yet. still developing)
Hi. I am using WP 3.0 and Atuahalpa theme version 3.5.1.
I installed your number-my-pages plugin, and though it worked fine, I have changed my mind and would like to uninstall. However, if I do, every page generates the error message “Fatal error: Call to undefined function mysinglepages() in /home/illogica/public_html/letstalk/wp-content/themes/atahualpa351/functions/bfa_postinfo.php(593) : eval()’d code on line 1″. Will only go away if I reinstall and reactivate your pluging.
Please can you help me uninstall your plugin.
Thanks
Jon Trevor
You need to go into your “bfa_postinfo.php” file and remove the line you added that has mysinglepages(….);
I added no code manually.
I have looked in bfa_postinfo.php and that line does not exist anywhere.
Any further suggestions?
thanks
jon
Can you check the single.php and see if its in there?
Atahualpa 3.5.1. doesnt’s seem to use a single.php or a page.php. As far as I can tell it keeps everything in its index.php.
Needles to say, I have looked in there as well and not found the rogue code.
Still looking.
Jon
I haven’t seen that theme so I don’t know which file it should be in but where ever you put that function, you need to take it out from there.
please re-read my earlier post. I did not put the function anywhere. I just activated the plugin. If the script was put somewhere, your plugin put it there. Now I can’t find it, and can’t uninstall your plugin without breaking all my posts.
Please advise.
Jon
The plugin doesn’t put any code inside any pages and that is related to your theme. You will find better help on their homepage http://wordpress.bytesforall.com/
I cannot provide support for their theme.
Ali
I’m not sure how else to say this clearly. My blog was working perfectly. I downloaded your plugin. I followed your instructions and copied the files to my /themes directory. I then actived the plugin, also as per your instructions. I did nothing else. I wrote no code. I edited no files.
Your plugin worked fine. It still works fine. But I decided I don’t like it. I de-activated it. Now every post generates the error I sent you. When I re-activate it, the error goes away. I don’t see how my theme has caused this problem. It is linked directly to the installing of your plugin. Somewhere along the line the activation has added some code to a file, and now my blog won’t run without your plugin, which I don’t actually want.
Your suggestion that the answer lies with Bytes For All support is disengenous to say the least.
jon
sorry, correction, i downloaded it to my /plugins directory
Ok my plugin would not work if you didn’t add the function to any file. If you look at the instructions that’s how it says the plugin works.
My plugin do not add any code in any file. It is written that way. Your theme has options and settings which I do not know about and will not be able to help you. When you disable the plugin, it only is disabled through WordPress backend.
I did not write any code. I did set some options using the Settings/My Number Post Pages menu. Could this have generated some code?
The plugin is working fine. You can see it in action at the webiste address I gave you.
jon
From your error it says that the function is trying to be called but since you removed the plugin it doesn’t exist so it’s failing. The code has to be included somewhere. Do a search in all your files for mysinglepages
Well, I’ve searched every file on the site for “mysinglepages” and the only one that showed up was your own readme.txt, which of course contains the phrase.
I am completely baffled and frustrated.
Jon
I too had a number of problems with Number My Post and later found out it had more to do with my tinkering with other WordPress php files. This in turn disrupted the proper operation of Number My Post. It forced me to do a clean install of WordPress and it worked perfectly after that.
This may not be the answer to your situation, but this is what solved it for me.
Hah! Found it. It was in the footer code held by Atahualpa, but not actually added to footer.php. Code removed, plugin deactivated, all good.
phew!