Linux 软件免费装

Category Posts in Custom Menu

开发者 anaid
更新时间 2023年7月8日 18:46
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 6.2.2
版权: GPL v2 or later

标签

posts automatic menu tag taxonomy custom category dynamic custom taxonomy post tag

下载

0.7.1 1.2.2 1.0 1.0.1 0.9.5 1.1 2.0.0 1.2.3 1.2.4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.7.2 0.8 0.9 0.9.1 0.9.2 0.9.3 0.9.4 1.2.0 1.2.1 1.3.0

详情介绍:

The default custom menu in WordPress 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. Also works for custom taxonomies and custom post types! Using it 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 category by the posts or pages themselves. For each Category or Post Tag item in the menu, you now have the following extra configuration options: Wildcards You can control the title of the menu items generated by the plug-in with the following wildcards:

安装:

  1. Upload category-posts-in-custom-menu.php to the /wp-content/plugins/ directory
  2. 通过 WordPress 的“插件”菜单激活插件

升级注意事项:

1.4.0 Now compatible with Wordpress 6.2. Important: Plugin has been split into a Free and a Premium version. The Free version now has more limited functionality. See Changelog. 1.3.0 Now compatible with WordPress 5.7. If you are on a WordPress version between 4.7 and 5.7.2, when encountering issues please report the WordPress version you're running. 1.2.3 Now compatible with WordPress 4.7! 1.2.2 New feature: Allow users to add their own wildcards. Minor: readme, unittests. 1.2.1 Bugfixes of minor issues

常见问题:

How do I use it?

Here's a walkthrough:

  1. Enable the Twenty Eleven theme.
  2. Disable all plugins except Category Posts in Custom Menu.
  3. Create a post with title "Post 1" and add a _new_ category "Category A"
  4. Save the post
  5. Go to Appearances > Menus
  6. Click "create a new menu"
  7. Add the category "Category A" by opening "Categories", checking that category and clicking "Add to menu"
  8. Open the menu item and check "Create submenu containing posts with this tag."
  9. Do not change anything else about the menu item
  10. Scroll all the way down and check under "Theme Locations" the checkbox "Primary Menu"
  11. Save the menu
If you now look at your blog, you will have a menu with only one item: "Category A". If you hover over that item with the mouse, it will open, and a post is displayed titled "Post 1". Add additional posts to Category A and you will see these additional posts in the menu.

Can't have more than 80/90 items in the menu

If your menu does not show more than about 80 or 90 items, this is not caused by my plugin or by WordPress itself. It is a server configuration issue. Try to increase the value of the max_input_vars variable in php.ini. The default is 1000, you may have success doubling this value, to 2000. Please note: Have this many items in your menu is a performance hit as well as a potential usability issue for your users.

Performance issues

The plugin is potentially very expensive, especially when you decide to build your entire menu out of nothing but category posts. The solution would be to cache the menu using transients, as reported here https://wordpress.org/support/topic/performance-problem-many-database-queries?replies=11#post-7829450

$my_cached_menu = get_transient( 'my_cached_menu'); if( $my_cached_menu === false ) { $my_cached_menu = wp_nav_menu( ... ); set_transient( "my_cached_menu_", $my_cached_menu, YEAR_IN_SECONDS ); } echo $my_cached_menu;

Can't see it working in any way

Problem: "I can't see what effect it has had. Nothing has changed (not that I can see) in the Appearance > Menu page. Just like before." If you are using a recent version of category Posts in Custom Menu and an updated version of WordPress, the problem can only occur due to your theme or other plugins conflicting with Category Posts in Custom Menu. Please disable all themes and plugins except CPCM; verify that the CPCM fields show; enable other plugins and themes one by one to determine which plugin/theme conflicts with CPCM.

更新日志:

1.4.0 Bugfix: On some mobile themes, the dropdown caret did not show. (As reported here: https://wordpress.org/support/topic/mobile-sub-menu-3/, and here: https://wordpress.org/support/topic/not-working-on-mobile-devices-16/) Split Free and Premium version: 1.3.0 Now compatible with WordPress 5.7. If you are on a WordPress version between 4.7 and 5.7.2, when encountering issues please report the WordPress version you're running. 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 1.1 1.0.1 1.0 0.9.5 0.9.4 0.9.3 0.9.2 0.9.1 0.9 0.8 0.7.2 0.7.1 0.7 0.6 0.5 0.4 0.3 0.2 Added checkboxes, dropdowns and text fields to Appearance > Menu. It is now possible to: