• Resolved neutie

    (@neutie)


    Hi there,

    I found a similar topic from a while back, but couldn’t find an answer I could use. Hopefully someone can help me.

    Currently I have the option for switching languages in the footer here: https://storyexperts.eu

    However, I would just like to show the flag of the language that you can switch to. I have two languages, Dutch (standard) and English. When I’m on the Dutch website, I would like it to show the English flag. And vice versa. So without drop down menus.

    Is this at all possible? If I need to put in code, where do I do this (if it’s PHP, I know where to put the CSS).

    Thanks a bunch.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter neutie

    (@neutie)

    I have tried different codes, but it won’t work.

    I found this code for example:

    if ( class_exists( 'WPGlobus' ) ) {
    			echo '<div class="wpglobus-selector-box">';
    				foreach( WPGlobus::Config()->enabled_languages as $lang ) {
    					if ( $lang == WPGlobus::Config()->language ) {
    						continue;
    					}
    					$flag = WPGlobus::Config()->flags_url . WPGlobus::Config()->flag[ $lang ];
    					echo '<a href="' . WPGlobus_Utils::localize_current_url( $lang ). '">';
    					echo '<img src="' . $flag . '" /> ';
    					echo '</a>';
    
    				}
    			echo '</div><!-- .wpglobus-selector-box -->';
    		}

    However, it adds an English flag to the top of my site. The problem I am facing is the following (see image, this is when I hover over the Dutch flag). I’d like to just have the English flag in the footer whenever I’m in Dutch language and vice versa.

    https://www.storyexperts.eu/language.png

    You can see it when you hover over the language in the footer on the site: https://www.storeyxperts.eu

    Hope someone can help. Thanks.

    Thread Starter neutie

    (@neutie)

    Does anyone have any idea? If one flag isn’t possible, would it at all be possible to at least have the other flag pop up next to my current language when hovering?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Showing just one flag’ is closed to new replies.