Forum Replies Created
-
AuthorPosts
-
Malo ZollikoferParticipant
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 !Malo ZollikoferParticipantI’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 !
-
AuthorPosts