Adding short description to menu items
Copy the below code and paste it anywhere in the functions.php file:
class My_Walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="' . esc_attr( $class_names ) . '"'; $output .= $indent . '
Copy the below code and paste it anywhere in the header.php file where you want to display your menu:
'main-menu', 'menu' => '', 'container' => false, 'container_class' => '', 'container_id' => '', 'menu_class' => 'none', 'menu_id' => 'none', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '', 'depth' => 1, 'walker' => $walker //Walker )); ?>