Working – Conditional menus based on custom post type with bulk edit!
-
This plugin worked great at first and then I thought it broke. However, the issue was a setting for my custom post types, which were set to ‘has_archive => true’ in functions.php. Here is the working setup:
To have the plugin work for custom post types, follow the instructions on this page: https://sevenspark.com/tutorials/menu-swapper-custom-post-types or just do a search for “menu swapper and custom post types” and it should be the first link in the search results.
In functions.php, set custom post types to ‘has_archive => false,’ and then select the ‘archive-my_custom_post_type.php’ archive page template in the Dashboard edit page for the specific page/post. This works on individual WP pages, which I use as the landing pages for all custom post types.
If you need to apply the custom fields Names and Values this plugin creates to multiple posts in bulk, use the Custom Field Bulk Editor plugin. Simply copy the Names and Values created by Menu Swapper in the bulk edit screen for each post type provided by the Custom Field Bulk Editor plugin. Click Save and the menus are applied to all pages!
This is the only combination that works with BuddyBoss Parent/Social Learner Child theme. The parent/child theme comes with a single top header menu, and uses a custom Walker class for the wp_nav_menu in header.php. No easy workaround to hard-code conditional top navigation menus based on custom post types. The above combo is a great time saver.
Thanks!
- The topic ‘Working – Conditional menus based on custom post type with bulk edit!’ is closed to new replies.