• The best import export plugin
  • Supports very large files
  • Simple interface & flexible API
  • Import, Export, Migrate, Bulk Edit

New Feature: Earn 12 Badges

Bild

Collect up to 12 exclusive badges by sharing your plugin collections and engaging with the community.

See all Badges

Custom Post Limits

by Scott Reilly

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’ );

All texts and images on this product page are protected by copyright and are the property of the author Scott Reilly. You will be redirected to the retailer to download the plugin. We act solely as a search engine for plugins and are not affiliated with the retailer or Scott Reilly.

Tags

Free Plugin

4.5
Reviews
Last Update
3 years ago
© 2021 – 2024 PluginGuru
All trademarks, logos and brand names are the property of their respective owners.
All company, product and service names used in this website are for identification purposes only.

Get your first Badge

Code Newbie

Earn your first badge by sharing your collections. Every master was once a beginner. Welcome to your coding journey.

0 of 5 views reached

Collections

Create your first Collection

Click the symbol on the desired plugin to create a collection. The symbol appears when you hover over the plugin.