Give your visitors the ability to easily access all your site’s content. Any page between 1 and 999 can be accessed with a maximum of 3 clicks (see screenshots).
- Easy access to all your website’s content
- Make searchengines happy by creating a more thorough internal linking structure
- No need to modify theme files! (see installation instructions)
- Modify labels and CSS and preview pagination in backend before using it in your frontend pages!
- Both default and pretty permalink structure are supported
- Custom queries are supported
- So far, this code has been tested on index, archive, custom post type archive, category and search pages of some of the most popular WordPress themes.
Please leave feedback, bug reports or comments at https://github.com/paddelboot/3pagination/issues
A brief Markdown Example
<?php if ( class_exists( 'threepagination' ) ) : threepagination::draw(); endif; ?>
/wp-content/plugins/directory OR choose
Plugins->Add Newand type “3pagination”.
- Activate the plugin through the
Pluginsmenu in WordPress
- Go to
Settings->3paginationto set labels, placement and CSS.
How to use
All options can be set in an options page, the pagination container can be injected or appended to the existing DOM.
If you are unsure about the HTML structure of your Website, you can do the following (in Firefox):
- Right click the spot where you wish the pagination to appear and choose `Inspect Element (Q)` from the menu list
- Copy the id of the container, i.e. #wrapper.someclass
- To append or prepend the pagination to this container, paste it’s id into the appropriate field of the Placement section under `Settings->3pagination`
- Choose on which pages (archives, search etc.) the pagination should appear. Done!
How to use – old school
You can, if you want (or to have your website degrade gracefully), call the class methods in your theme files.
draw() : Display the pagination
draw ( $pretty = TRUE, $max_num_pages = FALSE, $labels = TRUE, $css = ‘classic’, $wp_query = FALSE )
- $pretty (optional) | Are you using pretty permalinks?
- $max_num_pages (optional) | Limit to a maximum number of pages
- $labels (optional) | Display or not the navigation arrows
- $css (optional) | CSS class name that will be appended to the main div container
- $wp_query (optional) | custom WP query object
get() : Return the pagination as a HTML string
get ( $pretty = TRUE, $num_items = FALSE, $per_page = FALSE, $labels = TRUE, $css = ‘classic’, $wp_query = FALSE )
threepagination::draw ( TRUE, FALSE, FALSE, 'my_custom_class', FALSE )
Displays the pagination on a website that uses pretty urls, takes the standard page count, hides the navigation arrows, attributes a CSS class ‘my_custom_class’ to the pagination container and uses the global query object.
$string = threepagination::get ()
Save the pagination in the
Contributors & Developers
“3pagination” is open source software. The following people have contributed to this plugin.Contributors
- Initial version
- Improved arrow navigation
- replaced $num_items and $per_page with $max_num_pages
- Slightly changed CSS colors
- Stable version
- Fixed support of custom css styles via function parameter
- Added backend settings page
- Inject pagination into DOM
- Support for search templates
- Added checkbox for pretty URLs;
- Added option for max no. of pages
- Fixed link URL building;
- German localization;
- Plugin loading enqueued;
- Fixed bug with pagination link;
- Contextual help tab
- Fixed bug with default URLs pagination link
- New function parameter $wp_query : support for custom query object
- Fixed error message in options screen after fresh install