How to set # of most recent posts for Catloop
Posted 18 April 2013 - 08:07 PM
hi there, I have installed catloop in content area and would like to set a limit to how many display. Right now it paginates but this could get pretty long. Please advise how I can set this limit.
Posted 18 April 2013 - 09:28 PM
Setting a number of recent posts for CatLoop while also using pagination is not possible at this time because of some WordPress limitations. There are methods to limit the number of posts returned by a query, but none of them work with query_posts used by CatLoop.
get_posts has a misleading parameter "numberposts", which sounds like it would limit the posts returned, but, in effect "numberposts" and "posts_per_page", which is used in CatLoop, are interchangeable.
A painless way to reduce the number of pages showed in pagination is by using the WP-PageNavi plugin.
- in CatLoop settings, uncheck the box that makes CatLoop show its own pagination.
- go to PageLines > Drag & Drop and pull Page/Post Pagination right under CatLoop. You now get Next / Previous Post links.
- install the WP-PageNavi plugin, which will replace the Previous/Next with numbered pages.
- under Settings > Pagenavi, configure the text for the various pagination elements ( 3/150 instead of Page 3 of 150). You can also configure how many low-number and high-number pages to show.
On this site http://enachele.com/ at the bottom, the yellow pagination is set to show:
- Number of pages to show: 3
Number Of Larger Page Numbers To Show: 2
Show Larger Page Numbers In Multiples Of: 5
Let me know if you need further assistance.
Posted 19 April 2013 - 12:42 PM
Hi there! thanks so much! I'm looking forward to trying out that solution. Thanks for the tip! Will keep you posted if I have questions...