Second "menu"

Hi,
I have a question about menus. We have our main menu on the left hand side and I would like to add a little ‘menu’ on the top, right which would be the language switcher and the social media icons.
How can I do this, while keeping the main menu as is on the left?

Thanks!

Hello Charles,

Thanks for writing in! I have checked your site and I can see that you are using icon stack that displays the navigation fixed left. Adding another menu in the upper right corner will require custom development which is beyond the scope of our support.

Meanwhile, please check out SuperFly menu plugin which you can install by going to X > Validation > Extensions. To know more about this plugin, please check it here:

Hope this helps. Kindly let us know.

Thank you for your reply.
Is it possible to use the ‘TopBar’ for this purpose?
Can I change the background colour and get the language switcher that I have in the menu into this location?? I see the Social Media icons are present already…
Thanks!

Hi Charles,

You can utilize Topbar as well for this type of addition as it will accept HTML inside Topbar content area. You can enable Topbar by head over to X -> Theme Options -> Header -> Miscellaneous area.

So it should display as follows.

If you’re using WPML, you can refer to the following post (https://theme.co/apex/forum/t/wpml-language-switcher-position-at-topbar/52894/2?u=mldarshana) or you can implement your language switcher code as you prefer.

To change background color of your Topbar, you can add the following CSS rule into your X -> Theme Options -> CSS area and change the color values accordingly.

.x-topbar {
    background-color: rgba(0,0,0,0.45);
}

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Thanks!

Thanks a lot for your support! We’re nearly there :blush:
I have followed the threads and got it mostly sorted except that I can’t find out how to change the ovelapping text to simple flags with space between them… Do you have any ideas?
Many thanks!!

Hi @charleswerner,

To display flags only, you can add the code below in your child theme’s functions.php

function wpml_shortcode_lang() {
 
    $languages = icl_get_languages('skip_missing=0');
 
    if( 1 < count( $languages ) ) {
        $s = "";
        foreach( (array)$languages as $language ) {
            $s .= '<span><a href="' . $language['url'] . '"><img src="' . $language['country_flag_url'] . '" alt="" /> ' . $language['native_name'] . '</a></span> ';
        }
    }
 
    return $s;
}
add_shortcode( 'wpml_custom_lang', 'wpml_shortcode_lang' );

Then in _topbar.php replace this code <?php do_action('icl_language_selector'); ?> with this <?php echo do_shortcode('[wpml_custom_lang]');?>

Hope that helps

Thanks for getting back to me.
I don’t use WPML, I use Polylang for the language translation. I already have these flags active in the main menu, but I just don’t know how to get this into the topbar…

Thanks!

Hi @charleswerner,

You can try with this function instead: pll_the_languages(array('show_flags'=>1,'show_names'=>0));

Hope that helps and thank you for understanding.

Thanks. So I put this code pll_the_languages(array('show_flags'=>1,'show_names'=>0));
straight into the topbar.php file, replacing <?php pll_the_languages();?> code.
Do I need to put anything into the theme’s function.php? That part wasn’t clear to me.

As it stands, only 1 flag appears: the French one on the French text. There is no way to select the English equivalent…

Hey Charles,

You need to contact Polylang’s support or a third-party developer regarding what code to put in functions.php. We already have pointed what needs to be done on the part of the theme and we are not the best people to answer Polylang related questions.

Please also note that we do not have support for third party plugins.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.