[wordpress插件] Custom Post Limits自定义帖子限制

wordpress 插件 文章 2020-04-09 01:40 364 0 全屏看文

AI助手支持GPT4.0

评分
96
描述

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.

默认情况下,WordPress提供一个配置设置来控制博客的每个部分中应列出多少帖子。

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.

    如果特定字段类型的限制字段为空或0,则将应用默认的发布限制。

    If the value is set to -1, then there will be NO limit for that section (meaning ALL posts will be shown).

    如果该值设置为-1,则该部分将没有限制(表示将显示所有帖子)。

    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 |

    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).

    通常,理想情况下,应该将使用过滤器的代码放入mu插件或特定于站点的插件中(这不在本自述文件的解释范围内)。

    c2c_cpl_enable_all_individual_limits (filter)

    c2c_cpl_enable_all_individual_limits(过滤器)

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

    通过“ c2c_cpl_enable_all_individual_limits”钩子,您可以过滤是否为所有档案类型启用了单独的限制。

    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?

      • $ enabled(布尔值):是否为所有归档类型启用单独的限制?

        Default false.

      • 默认为false。

      Example:

      示例:

      // Enable individual limits for all archives for Custom Post Limits plugin.

        //为“自定义帖子限制”插件的所有档案启用单独的限制。

      add_filter( 'c2c_cpl_enable_all_individual_limits', '__return_true' );

      add_filter('c2c_cpl_enable_all_individual_limits','__return_true');

      c2c_cpl_enable_all_individual_{$type}_limits (filter)

      c2c_cpl_enable_all_individual _ {$ type} _limits(过滤器)

      The ‘c2c_cpl_enable_all_individual_{$type}_limits’ hook allows you to filter if individual limits are enabled for a specific archive type.

      通过“ c2c_cpl_enable_all_individual _ {$ type} _limits”钩子,您可以过滤是否为特定档案类型启用了单独的限制。

      The dynamic portion of the hook name, $type, refers to the type of archive with constituent individual archives.

      挂钩名称的动态部分 $ type 是指具有单独的单个档案的档案类型。

      Can be ‘authors’, ‘categories’, or ‘tags’.

      可以是“作者”,“类别”或“标签”。

      Arguments:

      参数:

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

        • $ enabled(布尔值):为给定的存档类型启用单个限制吗?

          Default false.

        • 默认为false。

        Example:

        示例:

        // Enable individual limits for author archives for Custom Post Limits plugin.

          //为“自定义帖子限制”插件的作者档案启用单独的限制。

        add_filter( 'c2c_cpl_enable_all_individual_authors_limits', '__return_true' );

        add_filter('c2c_cpl_enable_all_individual_authors_limits','__return_true');

安装步骤

    1. Whether installing or updating, whether this plugin or any other, it is always advisable to back-up your data before starting
    2. 无论是安装还是更新(无论是此插件还是其他插件),始终建议在开始之前备份您的数据

    3. Install via the built-in WordPress plugin installer.

    4. 通过内置的WordPress插件安装程序进行安装。

      Or download and unzip custom-post-limits.zip inside the plugins directory for your site (typically /wp-content/plugins/).

    5. 或在您网站的插件目录(通常为 / wp-content / plugins / )中下载并解压缩 custom-post-limits.zip

    6. Activate the plugin through the ‘Plugins’ admin menu in WordPress
    7. 通过WordPress中的“插件”管理菜单激活插件

    8. Click the plugin's Settings link next to its Deactivate link (still on the Plugins page), or click on the Settings -> <

    9. 单击插件的停用链接旁边的插件的 Settings 链接(仍在“插件”页面上),或单击 Settings -> <

      code>Post Limits link, to go to the plugin's admin settings page.

      code>发布限制链接,以转到插件的管理设置页面。

      Optionally customize the limits.

    10. (可选)自定义限制。

下载地址
https://downloads.wordpress.org/plugin/custom-post-limits.4.2.2.zip
-EOF-

AI助手支持GPT4.0