Custom Post Limits Wordpress Plugin - Rating, Reviews, Demo & Download
Plugin Description
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
-
A screenshot of the plugin’s admin settings page (with individual categories limits expanded) (top half of page). (Note: Screenshot hasn’t been updated to include fields for defining limits for custom taxonomies.)
-
A screenshot of the plugin’s admin settings page (with individual categories limits expanded) (bottom half of page). (Note: Screenshot hasn’t been updated to include fields for defining limits for custom taxonomies.)