badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Malo Zollikofer

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Put WMPL Language switcher next to the menu #50504
    Malo Zollikofer
    Participant

    Thanks ! With your indication, I finally managed to do what I wanted 🙂

    To maybe help other people, I changed the language_selector_flags function with:

    function language_selector_flags(){
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if(!empty($languages)){
            foreach($languages as $l){
                if(!$l['active']){
    				echo '<a href="'.$l['url'].'">';
    				echo '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />';
                    echo '</a>';
    			}
            }
        }
    }

    To only show the language that wasn’t active (don’t wanted to show a french flag is the user was actually on the french version)

    I placed: <div id="flags_language_selector"><?php language_selector_flags(); ?></div >

    at the ligne 223 (in the child theme), like that:

    echo '<nav id="access" class="clearfix">';
    			echo		'<div class="container clearfix">';
    				?><div id="flags_language_selector"><?php language_selector_flags(); ?></div ><?php
    				wp_nav_menu( $args );
    			echo '</div><!-- .container -->
    					</nav><!-- #access -->';

    So I had the flag inside the access and container div.

    Finally, I used this CSS: `#flags_language_selector {
    float: right;
    margin-right: 10px;
    margin-top: 5px;
    }`

    to have it at the right of the menu and looking aligned. I add some custom CSS to handle it correctly on the mobile view and I’m done !
    Thanks for the help !

    in reply to: Put WMPL Language switcher next to the menu #50457
    Malo Zollikofer
    Participant

    I’m a developer so I should be able to do that 😉 If you can just give me a direction about a file or smth where I can start it would be cool !

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