wordpress - How to exclude pages from nav menu -
how can exclude page(s) nav menu? found examples field called "exclude" added args , reportedly worked. maybe it's deprecated. have version 4.1.5.
my current code is:
$avia_theme_location = 'avia'; $avia_menu_class = $avia_theme_location . '-menu'; $args = array( 'theme_location' => $avia_theme_location, 'menu_id' => $avia_menu_class, 'exclude' => '29, 30, 31, 32', 'menu_class' => 'menu av-main-nav', 'container_class' => $avia_menu_class.' av-main-nav-wrap'.$icon_beside, 'fallback_cb' => 'avia_fallback_menu', 'walker' => new avia_responsive_mega_menu() ); wp_nav_menu($args);
where 29,30,31 , 32 pages ids want exclude , correct.
you may use this:
$args = array( // other values, 'exclude' => array(29,30,31,32) // <-- addedd ids exclude ); wp_nav_menu($args);
Comments
Post a Comment