Support » Theme: Supernova » How to Adress the menu-name of a menu?

  • Hello,
    I want to do a bilingual page and want to change the ‘categories’-nav-tab to the name of the menu (set in admin area) – clue: it should change when I change the language, actually the menu changes right, but the ‘categories’ not

    Supernova: top-most-navigation.php (template-parts/top-most-navigation.php) <<< there it is – HIGHLIGHTED

    <div class="sup-right-menu">
    			<div class="sup-nav-label">
    				<span class="sup-icon-menu"></span>
    				<span class="sup-nav-name"><?php /// I NEED TO WRITE THE RIGHT STUFF HERE /// ?></span>
    			<nav id="sup-cat-nav" class="sup-menu-container" role="navigation">
    				<?php wp_nav_menu( array( 'theme_location' => 'Header_Cat', 'menu_id' => 'sup-right-nav' , 'depth' => 1 ) ); ?>

    I tried $nav_menu = wp_get_nav_menu_object(25); echo $nav_menu->name; <- 25 is one of these two menus, but I don’t know how to adress the “higher instance”

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Sayed Taqui


    Why not add additional control under Display > Display Navigation in customizer.

    By registering like this.

    if ( class_exists( 'Nova' ) ) {
    	Nova::add_field( 'supernova', array(
    		'section'  => 'display_nav_section',
    		'settings' => 'sup_cat_menu_name',
    		'label'    => esc_attr__( 'Category Menu Name', 'supernova' ),
    		'type'     => 'text',
    		'priority' => 1,
    		'default'  => __( 'Categories', 'supernova' ),
    	) );

    and then get the value using

    get_theme_mod( 'sup_cat_menu_name' )

    considering you are using a child theme.

    Thread Starter ratmin0815


    Thank you for your help, but I am not the best at php :/

    I placed the first code in custom-functions.php – nothing showed up in Display > Display Navigation (should it be a special position in the code or another file?)

    and for the second code; so the line is:

    <span class="sup-nav-name"><?php get_theme_mod( 'sup_cat_menu_name' ) ?></span>

    I use supernova.2.0.61

    Theme Author Sayed Taqui


    Okay, I created the child theme for you which contains the feature you requested.

    You would need to adjust the css if you change category menu text.

    Read more about child themes here

    Thread Starter ratmin0815


    oh wow, thank you very much for creating this for me :), but actually it sets a name which is not able to change when I change the language – is it possible to set the name of the menu I created in admin area?

    for example:
    en-menu-name: exhibitions
    de-menu-name: Ausstellungen

    I created two menus which change due to language-selection

    Theme Author Sayed Taqui


    If you can explain in more detail, may be I can help you. How do you change the language? I think using some plugin? Do you have the ability to change two different menus for different languages?

    Thread Starter ratmin0815


    Yeah, I change the language with the plugin “polylang” it changes all content which has two (or more) options of language, so it also changes menus and this is why I want to set the name of the menu (the name I gave the menu in the menu-tab in the admin-panel) as headline, so it would change also – I just need to adress the actual used menu

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to Adress the menu-name of a menu?’ is closed to new replies.