AI助手支持GPT4.0
The custom menu only allows adding a link that leads to a list of posts and pages belonging to a taxonomy (category, tag, etc).
自定义菜单仅允许添加链接,该链接指向属于分类法(类别,标签等)的帖子和页面列表。
If you want to list the posts and pages themselves and if you want WordPress to do this automatically for you, then I hope you will find this plugin useful.
如果您希望自己列出帖子和页面,并且希望WordPress自动为您执行此操作,那么我希望您会发现此插件有用。 p>
Also works for custom taxonomies and custom post types! 也适用于自定义分类法和自定义帖子类型!PHP 7.0 compatible兼容PHP 7.0 strong> p>Using it使用 h4>Enable the plugin and go to Appearance > Menus.启用该插件,然后转到外观>菜单。Create your Custom Menu.创建您的自定义菜单。Add a taxonomy (category/tag/custom) to the menu.在菜单中添加分类法(类别/标签/自定义)。Next, you can choose if you would like to replace the original link (to a page that lists the items) by the posts and pages themselves.接下来,您可以选择是否要用帖子和页面本身替换原始链接(到列出项目的页面)。 p>For each Category or Post Tag item in the menu, you now have the following extra configuration options:对于菜单中的每个“类别”或“帖子标签”项目,现在都有以下额外的配置选项: p>replace the link by a list of posts in the menu y;通过菜单y / n中的帖子列表替换链接; li>specify the (maximum) number of posts you want to show for this item (-1 = all, 0 also allowed now);指定要为此项目显示的(最大)帖子数(-1 =全部,现在也允许0); li>their ordering ascending or descending by ID, Author, Title and other properties.其按ID,作者,标题和其他属性的升序或降序。See ‘Other Notes > Ordering’;请参阅“其他说明>订购”; li>keep or remove the original menu item (always / only if there are no posts / never);保留或删除原始菜单项(始终/仅当没有帖子时/永不); li>specify the title for the menu items.指定菜单项的标题。For this you can use %post_title, %post_author and other wildcards, see ‘Other Notes > Wildcards’.为此,您可以使用%post_title,%post_author和其他通配符,请参阅“其他说明>通配符”。 li> ul>Details详细信息 h4>This plugin uses the wp_nav_menu_objects filter hook to remove and replace category items in the menu by the posts in that category.此插件使用wp_nav_menu_objects过滤器挂钩删除菜单中的类别项,并用该类别中的帖子替换。It extends Walker_Nav_Menu_Edit to add input fields to Appearance > Menus and adds some CSS to style this properly.它扩展了Walker_Nav_Menu_Edit,以将输入字段添加到“外观”>“菜单”,并添加一些CSS来正确设置样式。 p>The plugin now supports the wp_nav_menu_item_custom_fields hook and should be compatible with other plugins that also use this hook.该插件现在支持wp_nav_menu_item_custom_fields挂钩,并且应该与也使用此挂钩的其他插件兼容。 p>Wildcards通配符 h4>You can control the title of the menu items generated by the plug-in with the following wildcards:您可以使用以下通配符控制由插件生成的菜单项的标题: p>%post_title%post_title li>%post_author%post_author li>%post_featured_image_url%post_featured_image_url li>%post_featured_image (insers an HTML ‘img’ tag with the featured image or nothing if there is none)%post_featured_image(插入带有特征图像的HTML'img'标签,如果没有则为空) li>%post_featured_image_thumb_url%post_featured_image_thumb_url li>%post_featured_image_thumb (insers an HTML ‘img’ tag with the featured image thumbnail or nothing if there is none)%post_featured_image_thumb(插入带有特征图像缩略图的HTML'img'标签,如果没有,则不添加标签) li>%post_excerpt%post_excerpt li>%post_url%post_url li>%post_date for the unformatted post date: 2012-11-10 18:14:23%post_date为未格式化的发布日期:2012-11-10 18:14:23 li>%post_date() for a formatted post date with the following default formatting: November 10th, 2012%post_date()表示采用以下默认格式的带格式发布日期:2012年11月10日 li>%post_date() for custom date formatting.%post_date(<此处为您的格式>)用于自定义日期格式。Example: %post_date(l jS \of F Y, h:i:s A).示例:%post_date(FY的ljS \,h:i:s A)。See https://codex.wordpress.org/Formatting_Date_and_Time for formatting options.有关格式设置选项,请参见 https://codex.wordpress.org/Formatting_Date_and_Time 。 li>%post_date_gmt%post_date_gmt li>%post_date_gmt()%post_date_gmt() li>%post_date_gmt()%post_date_gmt(<此处为您的格式>) li>%post_status%post_status li>%post_modified%post_modified li>%post_modified()%post_modified() li>%post_modified()%post_modified(<您的格式此处>) li>%post_modified_gmt%post_modified_gmt li>%post_modified_gmt()%post_modified_gmt() li>%post_modified_gmt()%post_modified_gmt(<此处为您的格式>) li>%post_comment_count%post_comment_count li>wildcards for custom fields, like %post_my_field, where ‘my field’ or ‘my_field’ is a custom field用于自定义字段的通配符,例如%post_my_field,其中“我的字段”或“ my_field”是自定义字段 li> ul>The following wildcards are deprecated:不推荐使用以下通配符: p>%post_feat_image (url only)%post_feat_image(仅URL) li>%post_feat_image_thumb (url only)%post_feat_image_thumb(仅URL) li> ul>Ordering订购 h4>You can control the ordering of the items in the menu by sorting ascending or descending on the following properties:您可以通过对以下属性进行升序或降序排序来控制菜单中各项的顺序: p>None没有 li>ID ID li>Author作者 li>Title标题 li>Date日期 li>Last Modified最后修改 li>Post/Page parent ID帖子/页面的父ID li>Random Order随机顺序 li>Number of Comments评论数 li>Menu Order – Ordering by menu order is only possible for hierarchical types, such as pages.菜单顺序–按菜单顺序排序仅适用于分层类型,例如页面。These have the ‘Order’ option when editing, this is the menu order.这些在编辑时具有“订单”选项,这是菜单顺序。 li> ul>Extend the plugin扩展插件 h4>The plugin behavior can be extended.可以扩展插件的行为。 p>To extend the backend with your own controls and use them in the posts query, add the following:要使用您自己的控件扩展后端并在帖子查询中使用它们,请添加以下内容: p>Action “cpcm_custom_fields”: Use this to extend the custom fields to add to the Category Posts in Custom Menu container in Appearance > Menus动作“ cpcm_custom_fields”:使用它来扩展自定义字段,以添加到“外观”>“菜单”中“自定义菜单”容器中的“类别帖子” li>Filter “cpcm_filter_posts_query”: This filter is called when the menu_item is of taxonomy type and the “Create submenu containing links to posts in this category” is checked.过滤器“ cpcm_filter_posts_query”:当menu_item为分类类型并且选中了“创建包含该类别文章链接的子菜单”时,将调用此过滤器。Here, you can add or modify the posts query to your liking.在这里,您可以根据自己的喜好添加或修改帖子查询。 li> ul>To add your own wildcards, add the following:要添加自己的通配符,请添加以下内容: p>Filter “cpcm_replace_user_wildcards”: Called after all default CPCM wildcards have been processed.过滤器“ cpcm_replace_user_wildcards”:在处理完所有默认CPCM通配符之后调用。 li> ul>You can see an example in the sample-cpcm-extension directory, included in the plugin code.您可以在包含在插件代码中的sample-cpcm-extension目录中看到一个示例。 p>
也适用于自定义分类法和自定义帖子类型!PHP 7.0 compatible
PHP 7.0 compatible
兼容PHP 7.0 strong> p>
Enable the plugin and go to Appearance > Menus.
启用该插件,然后转到外观>菜单。
Create your Custom Menu.
创建您的自定义菜单。
Add a taxonomy (category/tag/custom) to the menu.
在菜单中添加分类法(类别/标签/自定义)。
Next, you can choose if you would like to replace the original link (to a page that lists the items) by the posts and pages themselves.
接下来,您可以选择是否要用帖子和页面本身替换原始链接(到列出项目的页面)。 p>
For each Category or Post Tag item in the menu, you now have the following extra configuration options:
对于菜单中的每个“类别”或“帖子标签”项目,现在都有以下额外的配置选项: p>
li>
See ‘Other Notes > Ordering’;
请参阅“其他说明>订购”; li>
For this you can use %post_title, %post_author and other wildcards, see ‘Other Notes > Wildcards’.
为此,您可以使用%post_title,%post_author和其他通配符,请参阅“其他说明>通配符”。 li>
ul>
This plugin uses the wp_nav_menu_objects filter hook to remove and replace category items in the menu by the posts in that category.
此插件使用wp_nav_menu_objects过滤器挂钩删除菜单中的类别项,并用该类别中的帖子替换。
It extends Walker_Nav_Menu_Edit to add input fields to Appearance > Menus and adds some CSS to style this properly.
它扩展了Walker_Nav_Menu_Edit,以将输入字段添加到“外观”>“菜单”,并添加一些CSS来正确设置样式。 p>
The plugin now supports the wp_nav_menu_item_custom_fields hook and should be compatible with other plugins that also use this hook.
该插件现在支持wp_nav_menu_item_custom_fields挂钩,并且应该与也使用此挂钩的其他插件兼容。 p>
You can control the title of the menu items generated by the plug-in with the following wildcards:
您可以使用以下通配符控制由插件生成的菜单项的标题: p>
Example: %post_date(l jS \of F Y, h:i:s A).
示例:%post_date(FY的ljS \,h:i:s A)。
See https://codex.wordpress.org/Formatting_Date_and_Time for formatting options.
有关格式设置选项,请参见 https://codex.wordpress.org/Formatting_Date_and_Time 。 li>
The following wildcards are deprecated:
不推荐使用以下通配符: p>
You can control the ordering of the items in the menu by sorting ascending or descending on the following properties:
您可以通过对以下属性进行升序或降序排序来控制菜单中各项的顺序: p>
These have the ‘Order’ option when editing, this is the menu order.
这些在编辑时具有“订单”选项,这是菜单顺序。 li>
The plugin behavior can be extended.
可以扩展插件的行为。 p>
To extend the backend with your own controls and use them in the posts query, add the following:
要使用您自己的控件扩展后端并在帖子查询中使用它们,请添加以下内容: p>
Here, you can add or modify the posts query to your liking.
在这里,您可以根据自己的喜好添加或修改帖子查询。 li>
To add your own wildcards, add the following:
要添加自己的通配符,请添加以下内容: p>
You can see an example in the sample-cpcm-extension directory, included in the plugin code.
您可以在包含在插件代码中的sample-cpcm-extension目录中看到一个示例。 p>
category-posts-in-custom-menu.php
/wp-content/plugins/
category-posts-in-custom-menu.php code>上载到 / wp-content / plugins / code>目录 li>Activate the plugin through the ‘Plugins’ menu in WordPress通过WordPress中的“插件”菜单激活插件 li>
/ wp-content / plugins / code>目录 li>Activate the plugin through the ‘Plugins’ menu in WordPress通过WordPress中的“插件”菜单激活插件 li>
ol>
原文出处:http://www.sanshu.cn/a/6569.html
群主管理都是支付大佬