Navigation / Menu Descriptions

Community Forums Forums General Discussion Navigation / Menu Descriptions

This topic is: resolved

This topic contains 3 replies, has 3 voices, and was last updated by  philweb 2 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #50914


    I want to do a Menu WITH description using Generate Theme. I saw a theme related to what i wanted:

    This time, i want it on the primary navigation.

    Something like this:

    I already activated the description in the “Screen Options” on Appearance>Menus .

    I tried to ‘google it’ but can’t find something that work

    • This topic was modified 2 years, 4 months ago by  philweb.
    • This topic was modified 2 years, 4 months ago by  philweb.


    You need to add the code to call it in the functions.php file. In the case of the Backcountry theme, the function is in the secondary menu, and the functions.php includes this code:

    /** Add description to secondary navigation */
    add_filter( ‘walker_nav_menu_start_el’, ‘add_description’, 10, 4 ); 
    function add_description( $item_output, $item, $depth, $args ) {
    	$args = (array) $args;
    	if ( $args[‘theme_location’] != ‘primary’ )  {
    		return preg_replace( ‘/(<a.*?>[^<]*?)</’, ‘$1′ . "<span class=\"menu-description\">{$item->post_content}</span><", $item_output ); 
    	else {
    		return $item_output;

    You can adjust the code accordingly to reference the primary menu.

    Susan @ One Happy Studio I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts



    Great tip Susan!



    done. Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Navigation / Menu Descriptions’ is closed to new replies.