Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
To use pagination, you need to set the following parameters in the shortcode:
pagination set it to yes.
numberposts - Posts per page are set with the
[catlist pagination=yes numberposts=5]
instance (only necessary when using the shortcode with pagination more than once in the same page/post) - a number or name to identify the instance where you are using pagination. Since you can use the shortcode several times in the same page or post, you need to identify the instance so that you paginate only that instance.
[catlist id=3 numberposts=5 pagination=yes instance=1]
[catlist id=5 numberposts=15 pagination=yes instance=2]
Bookmarks in pagination links
Pagination links are automatically appended with bookmarks to the list they are part of, i.e. lcp_instance. While this is desirable by many users, it can cause a real mess in many (badly written 😉 ) themes and plugins. So @zymeth25 proposed the
pagination_bookmarks shortcode parameter. If present and set to
no the plugin won't append bookmarks to pagination URLs.
Default example link
Next and Previous buttons
You can customize what to show for the "next" and "previous" buttons in the pagination navigation. Use the following params:
- pagination_prev - Replace the "<<" characters in the "previous" button in the pagination navigation with a custom text.
- pagination_next - Replace the ">>" characters in the "next" button in the pagination navigation with a custom text.
You can also set a default value for pagination in the Options Page. This will apply every time you use the shortcode. You can override the option by using
pagination='no' in the shortcode. Note: for full backward compatibility
pagination='false' work as well.
Changing the pagination CSS
If you want to customize the way the pagination is displayed, you can
lcp_paginator.css file from the plugin's directory to your
theme's directory and customize it. Do not customize the file on the
plugin's directory since this file will be overwritten every time you
update the plugin.
The current page in pagination has its own CSS class:
"Previous" and "next" links in pagination navigation have their own classes too:
<a href="[next page URL]" class='lcp_nextlink'>>></a>
<a href="[previous page URL]" class='lcp_prevlink'><<</a>
So you can style the current page number and "next"/"previous" buttons differently if you want to.