Tag Info

Hot answers tagged

1

You can modify your menu by using walker. include('subMenu.php'); $menu = wp_nav_menu( array('menu' => 'YOUR-MENU-NAME','menu_class' => 'megamenu','walker' => new subMenu)); create a file subMenu.php in theme folder add below code. <?php class subMenu extends Walker_Nav_Menu { function end_el(&$output, $item, $depth=0, $args=array()) ...


1

That's a nice option, but I agree with sri, right now it really depends on your theme. You can do a work-around through is_page(). You need to write something like this on your page.php theme file: <?php if (is_page('projects')) { if ( is_active_sidebar( 'sidebar-navigation' )) { dynamic_sidebar( 'sidebar-navigation' ); } ...


1

Here's how I solved it so far. class themename_walker_nav_menu extends Walker_Nav_Menu { function start_el( &$output, $item, $depth, $args ) { $slug = get_post( $item->object_id )->post_name; $item->url = "#{$slug}"; return parent::start_el( $output, $item, $depth, $args ); } }



Only top voted, non community-wiki answers of a minimum length are eligible