Custom Post Limits

plugin banner

Version: 3.6

Independently control the number of posts listed on the front page, author/category/tag archives, search results, etc.

Author:Scott Reilly (profile at wordpress.org)
WordPress version required:4.9
WordPress version tested:5.7.2
Plugin version:4.4.1
Added to WordPress repository:16-07-2009
Last updated:14-04-2021
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:86
Rated by:6
Plugin URI:https://coffee2code.com/wp-plugins/custom-pos...
Total downloads:57 462
Active installs:2 000+
plugin download
Click to start download

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

By default, WordPress provides a single configuration setting to control how many posts should be listed in each section of your blog. This value applies for the front page listing, author listings, archive listings, category listings, tag listings, custom post type listings, custom taxonomy listings, and search results. This plugin allows you to override that value for each of those different sections.

Specifically, this plugin allows you to define limits for:

  • Authors archives (the archive listing of posts for any author)
  • Authors archives non-first-page (when paging through authors archives listings, number of posts listed when not on the first page)
  • Author archives (the archive listing of posts for any specific author)
  • Categories archives (the archive listings of posts for any category)
  • Categories archives non-first-page (when paging through categories archives listings, number of posts listed when not on the first page)
  • Category archive (the archive listings of posts for any specific category)
  • Custom post type archives (the archive listings of posts for any specific custom post type)
  • Custom taxonomy (the archive listings of posts for any specific custom taxonomy)
  • Day archives (the archive listings of posts for any day)
  • Day archives non-first-page (when paging through day archives listings, number of posts listed when not on the first page)
  • Front page (the listing of posts on the front page of the blog)
  • Front page non-first-page (when paging through front page listings, number of posts listed when not on the first page)
  • Month archives (the archive listings of posts for any month)
  • Month archives non-first-page (when paging through month archives listings, number of posts listed when not on the first page)
  • Search results (the listing of search results)
  • Search results non-first-page (when paging through search results listings, number of posts listed when not on the first page)
  • Tags archives (the archive listings of posts for any tag)
  • Tags archives non-first-page (when paging through tags archives listings, number of posts listed when not on the first page)
  • Tag archive (the archive listings of posts for any specific tag)
  • Year archives (the archive listings of posts for any year)
  • Year archives non-first-page (when paging through year archives listings, number of posts listed when not on the first page)

If the limit field is empty or 0 for a particular section type, then the default post limit will apply. If the value is set to -1, then there will be NO limit for that section (meaning ALL posts will be shown). The Archives Limit value is also treated as the default limit for Day, Month, and Year archives, unless those are explicitly defined.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Hooks

The plugin exposes a number of filters for hooking. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain).

c2c_cpl_enable_all_individual_limits (filter)

The ‘c2c_cpl_enable_all_individual_limits’ hook allows you to filter if individual limits are enabled for all archive types.

The ability to set individual limits (e.g. for per-author or per-category archives) isn’t simply enabled by default because it can have a negative performance impact depending on the number of items. Especially for a something most sites are unlikely to need.

Arguments:

  • $enabled (boolean): Enable individual limits for all archive types? Default false.

Example:

// Enable individual limits for all archives for Custom Post Limits plugin.
add_filter( 'c2c_cpl_enable_all_individual_limits', '__return_true' );

c2c_cpl_enable_all_individual_{$type}_limits (filter)

The ‘c2c_cpl_enable_all_individual_{$type}_limits’ hook allows you to filter if individual limits are enabled for a specific archive type. The dynamic portion of the hook name, $type, refers to the type of archive with constituent individual archives. Can be ‘authors’, ‘categories’, or ‘tags’.

Arguments:

  • $enabled (boolean): Enable individual limits for given archive type? Default false.

Example:

// Enable individual limits for author archives for Custom Post Limits plugin.
add_filter( 'c2c_cpl_enable_all_individual_authors_limits', '__return_true' );

Screenshots
FAQ
ChangeLog