I'm using the built in menu manager to create my menues and I disaply them by using wp_nav_menu().
I'm wondering, is it possible to remove certain menu items from being displayed based on some specific condition?
|
I'm using the built in menu manager to create my menues and I disaply them by using I'm wondering, is it possible to remove certain menu items from being displayed based on some specific condition? |
|||
|
|
|
How about a custom menu walker? http://erikshosting.com/wordpress-tips-code/building-a-wordpress-walker-creating-custom-dynamic-menu-outputs/ |
|||
|
|
|
Use the wp_nav_menu_objects filter to adjust the menu items using whatever conditions you like. The filter will receive and return an array of the menu items. |
|||||
|
|
if our menu is pages you can use Exclude Pages from List Just use the id of pages sepearated b comma
UPDATE Try this one Go to Appearance -> Menu and then from there click "Create Menu" then add menus that you want to include and you can set a Location for menus with this code below try to explore
|
|||||||
|
|
Instead of using http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items |
|||
|