Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Adjusting Position of WPML Switcher WordPress

  • SOLVED

Site: www.ghlazzerini.it

i want insert the <?php do_action('icl_language_selector'); ?> on the top right where now i've put another flag for languages.


please help me as soon as ! thanks!

Answers (1)

2013-03-25

Susanta K Beura answers:


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" />';
if(!$l['active']) echo '</a>';
}
}
}

you put the function in your functions.php template of your theme and put this
<div id="flags_language_selector"><?php language_selector_flags(); ?></div >
in the template where you want the language switcher to appear.


Thank you

Regards,
Susanta