Custom Post Limits v2.6

I’d lke to announce the official release of the updated Custom Post Limits plugin (v2.6) for WordPress.

Control the number of posts that appear on the front page, search results, and author, category, tag, and date archives, independent of each other, including specific archives.

This release features a reversion to the v2.0 method of post limiting, but with a fix for individual archive limiting (ostensibly the primary thrust behind the v2.5 release, but the approach used in that release caused other conflicts). It also adds the ability to “Reset Settings” and other minor tweaks and code documentation.

The plugin’s official homepage is located at :
coffee2code.com/wp-plugins/custom-post-limits.

Comments welcome on this post for this version of the plugin. Comments will be closed once this release has been superseded by another.

Read more for a detailed ChangeLog of the release.

Detailed ChangeLog

These are the detailed changes, some of which may or may not make sense to you depending on your familiarity with the previous features and internals of the plugin.

  • Revert post limiting back to hooking ‘pre_option_posts_per_page’ rather than filtering ‘post_limits’ (fixes bug introduced in v2.5)
  • Fix bug related to individual author/category/tag limits not applying (the primary intent of the v2.5 release, but needed re-fixing due to reversion)
  • Fix bug preventing value of individual limits from appearing on settings page (the value had been saved and used properly, though)
  • Add ‘Reset Settings’ button to facilitate resetting all limits configured via the plugin
  • Internal: add get_authors(), get_categories(), get_tags() to retrieve and buffer those respective values if actually needed
  • Update object’s option buffer after saving changed submitted by user
  • Add PHPDoc documentation
  • Update .pot file
  • Minor documentation tweaks

13 Responses to “Custom Post Limits v2.6”

  1. With version 2.5 (on WP 2.9), on a site I have in development, I had an issue with category archive pages.

    When specific category archive pages were limited with this plugin, to a certain amount of posts per page, and the archive went into several pages, some of the same posts would show up on more than one page. Think this may have been just the last page where this occurred. Where a few posts would show again.

    2.6 has fixed this issue!

    Great plugin.

  2. Roger replied on

    Where can I find version 2.5 to redownload?

    With version 2.5, when I limit the top parent category to 1 post, the page navigation isn’t displayed and with the child categories, I limit it to three posts and the page navigation is displayed if there are more than 3 posts.

    With version 2.6, now the parent category will have a page navigation to all posts to also include the child categories. Grrr!

    I thought maybe the category assigment was the issue, but it wasn’t.

    My heirachy [sp] for each top category: I only have a parent category (top) and 1 level of child categories under it. It doesn’t go any deeper. Each parent category only has one post. Each child categories has many posts.

    Each post only has one category assigned to it (I don’t assign multiple categories to one post).

    So I want to revert, can I have the earlier revision?

  3. My site has been showing 2 posts and I want it to show only 1. I downloaded your plugin and left all fields empty, but my homepage is still showing 2 posts.

  4. Roger: If you really want them, you can find the files for v2.5 here: svn.wp-plugins.org/custom-post-limits/tags/2.5/

    When I get a chance I’ll revisit the plugin with your comments in mind to see if the behavior you are describing is an error or expected. Of course, if it is an error I will seek to correct it. v2.6 by all accounts is improvement over v2.5, so it’s possible the behavior you desired was a result of a bug in v2.5. I’ll try to email you in the future if I need more feedback about what you were trying to accomplish.

  5. Jim: Downloading and installing the plugin but without configuring it will not cause any changes to your site. You must specify limits via the plugin’s settings page in order to get the limits you want. Since you haven’t specified any, the default for your site, 2, will continue to be used. If you wish your front page to show 1, you must provide that value into one of the input field for the “Front Page” limit.

  6. Nice plugin but my browser crashes because ive too many authors, cats and tags! Stupid ist the link to hide/show the eg authors because i must wait until the side is loaded…

  7. Thank you for the plug! It is very urgent for absolutely any version of WordPress.

  8. Scott — Great plug-in! It’s working perfectly on my blog…but:

    I’ve set it to display 12 posts in each of the monthly archive pages. But only the first post of that month displays the full post. After that, the rest of them display the title and “Read the full article ?”

    Do you have any idea what I need to change so that ALL the posts in the monthly archive page are displayed in full?

    Thanks for any help.

  9. Thank you so much for this plugin. It is exactly what I was looking for. I wanted to make archive/tag pages have more posts since they only contain excerpts; and the front page to have less posts since it contains full-length posts. Well, Custom Post Limits does just that, works fine with WP PageNavi, and is super easy to install and configure. Thumbs up.

  10. Any plans to update this plugin for WP 3 and above? I’d love to use it, but when I install it, weird behavior starts (like regular posts failing to ever load, and my entire site grinding to a crawl). Once I deactivate the plugin (and delete the files!) things get back to normal. I did that whole process (install, activate, configure, test, panic, deactivate, delete) twice so I’m 99% sure it’s this plugin that’s causing it.

    Reckless of me, I know, to install it on WP3 when it clearly says it’s not tested on that version, so I’m hoping you have plans to update it as the functionality is exactly what I’m looking for.

    Thanks!

  11. Hi there,
    I’m trying to implement your plugin “custom post limits” but I’ve run into two snags

    1. it displays “older posts/newer posts” at the top and bottom. Is there anyway to do it at the bottom

    2. where do I go to style the link and/or add a class to it.

    Thanks!

  12. Joe: Sounds like you need to modify the theme template file used to render your monthly archives. The precise file used can vary depending on the theme. You can try using my Reveal Template plugin to help figure out which is in use, and change that.

    This plugin only controls the number of posts shown (which it sounds like it is doing correctly in your case) and not anything related to how they are shown.

    illi, Kermit: An update is in the works to reduce the excessive load the current version causes for some people.

  13. Scott: I’m not quite sure your request is directly related to the Custom Post Limits plugin. The plugin only controls the number of posts listed on different pages of your blog. It does not output any links or markup on the front-end. The “older/newer” navigation links are usually the product of your theme or possibly a plugin (if you installed one for that purpose). The plugin only outputs stuff on its admin page.

    Unless I’ve misunderstood your question?

    If it’s the theme files you want to modify, the things you’d need to change would vary depending on the theme. If you are using a Twenty Ten based theme, you’ll find what you want in the theme’s loop.php file. Otherwise, you’ll have to review some of the theme’s files (typically index.php, archive.php, category.php, search.php, tag.php, etc) to find the navigation markup so you can remove the top one and add a class to it.

    Hope that helps!

Leave a Reply

Please keep these things in mind:
Comments may be moderated.
Don't say obviously spammy words (poker, penis, etc)
Basic HTML allowed: i, b, code
Wrap code examples in code tags.