Pagination for Pages is a WordPress plugin that allows you to easily create pagination style navigation elements for pages (or any other custom post type). It uses a numerical based system along with next & back navigation elements.
The plugin includes a single function, pagination_for_pages(), that accepts a single parameter, $getPagesQuery. The parameter is fed to get_pages(); default options are “sort_column=menu_order&sort_order=asc“. Override that with whatever you want from the get_pages() documentation. The function returns an unordered list with the class of paginationForPages.
We’re using this plugin in the Project section of our website. Take a look at the bottom of the Neotech Aqua project page for a visual example. Here’s the code that we’re running:
<?php
if (function_exists('pagination_for_pages')) {
echo pagination_for_pages('post_type=project&sort_column=post_date');
}
?>
.paginationForPages {
list-style:none;
text-align:center;
margin:0;
padding:0;
}
.paginationForPages li {
display:inline;
font-size:.9em;
padding:0 .25em;
}
I am trying to use your plugin to only show the children of the current page. I have tried many things but nothing is working. “child_of” does not seem to be working. Any ideas?
post_parent."&echo=0")');
}
?>
if (function_exists('pagination_for_pages')) {
echo pagination_for_pages('post_type=project&sort_column=post_date');
}
The plugin is only designed to work with items at the same level in the hierarchy. You would have to modify it to work with children.
you should provide screen shot for the result of your plugin work. not only show the code source
Hi,
I have a problem in WP 3.3 where only four posts show on my http://www.factionbikeco.com/racing/ page, there are 9 posts assigned to the racing category (I use posts-to-page plugin to assign category posts to that page).
I tried your plugin but no pagination shows up. I put the php code from the single-project example into several templates and added the CSS sample code.
I’m using Sideways theme with conventional vertigal blog layout.
I’m not sure where in the teplate files the code should be placed.
Thanks in advance.
The link you provided is 404′d.
Hi thanks for looking, the editor has hidden the page while adding images. I fixed the error, it was due to a plugin ‘page and post lister’ .
I am trying to use your plugin as I cannot find any others for pages. I have installed it on my wordpress website and added the above example code to my index.php file (since I didn’t know where else to put it) and added the css to my custom css file. All that to say is that nothing happens. Where do I control which pages wrap to another page? Or call up the plugin for that particular page? Determine the length of a page before wrapping?
I’m not very familiar with wordpress coding. If any help could be given it would be much appreciated.
Thanks!
The example code only works for a custom post type that we have setup on this site. If you want to use this on your site, you’ll need to change the parameters you send into the function.
I downloaded the plugin and need some guidance.
I have a single page created with 3 sub-pages within a drop menu.
example:
Main Page
page 1
page 2
page 3
I wish to simply add navigation to the bottom of each of the 3 pages to toggle between. What code should I be copying? Where am I pasting it to? What elements am I changing in the code to function as desired? Any help would be most appreciated!
Thanks
I can help you with your navigation – If you can help me make this Plugin runnin.
I installed and added the code to the page.php
no errors and no function and I can see nothing?
Hi,
I installed it and put the code into the page.php – but there is no result.
No errors and no funtion I can not see anything.
What I els do I have to do
is it possible that this thing is only working with posts not pages?
Raph, what code are you using in your page template? The plugin works with any post type.
Hi Matt,
this pagination plugin has the feature like
<>?
Or it just add numbers to the pagination and will stretch the page or wrap below.
That is not a feature of this plugin.
I know this plugin do not have this feature thats why I post here and hope you can add it. I have lots of pages and the pagination just wrap down the page and look ugly.
There are no plans to add that feature at this time.
ok no problem
Maybe I didnt explain myself clearly, look at your project examples page, you have 28 pages now 1 2 3 4 5 6 7 8 9 10 11 12 13–28, if you add more pages say over 30, the pagination numbers will wrap down. Hope you can add feature like max pagination show will be 20, if more than 20 will show a next 10, or something.
Sorry the code did not display..
What I mean is like prev 10 or next 10, if not the number will keep adding and stretch a long line to your page.
Hi there, I’m going to try your plugin. I’m new to the coding aspect of this. PHP etc…
Where do I drop the code into to make this plugin work? I’m fairly sure it just doesn’t work once it’s enabled right?
I see in the readme that there is a line of code, but where do I put it? For those not so code savvy it’d be helpful to add a little extra example.
Please let me know! Thanks!
I also want to add that I’m using this to paginate between pages. Not posts. Thanks!
M
page.php of your active theme would be a good place to start.
Ok so do some templates have it labeled as main-page.php? Or is this something I won’t be able to access through the editor?
Once I’m there, then what?
I do appreciate any help. I’ve never modified the php before. Sorry if it’s totally pedestrian to you but it’s new stuff for me.
cheers!
That is possible. You’ll want something like this;
if (function_exists(‘pagination_for_pages’)) {
echo pagination_for_pages(‘post_type=page&sort_column=post_date’);
}
Does that go before any specific line or do I insert that code into the existing section?
Here’s what I’m looking at:
If this isn’t the right page then just let me know. I’ll dig further in the backend.
Thanks Matt.
sorry code didn’t show… anyway, do I put it in before the end of the php section?
So if I want to only show certain pages… for instance if they have an order? 1,2,3,4,5 etc…
First one is titled “Contributors” with a grid of 18 images, then the page navigation would be at the bottom. this first page would be 1…
subsequent from there would be contributors 2, contributors 3 etc…
So I only want to paginate on a specific page and not the whole site and have it’s other pages as pagination beneath on that one page (contributors 2 etc) and the subsequent pages…
Would that code be right? I got a syntax error and the site broke. I know I’m missing something here. trying to wrap my head around it. I seems easy enough but I feel I’m missing some key components.
Thanks
The level of support you’re looking for goes beyond what I can provide via comments. You should hire a developer to help you implement this..
hi matt…very nice post..it really helped me.
is there any easy option to set pagination for a child pages.??? for example like i have about us page but it has 5 child pages…so can i show pagination for 5 child pages on about us page..???
page-about us
e.g.
previous> 1.2.3.4 <next
or it can be
previous> Page 1 of the 4 <next