/ Published in: PHP
Of course the Plugin from wpml.org has to be installed, the file "wpml-integration.php" from docs/theme-integration has to be copied into your theme-directory and the call include "wpml-integration.php"; has to be copied to your functions.php. After that, you can simply place
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Languages links to display in the header // function wpml_languages_list_notext($skip_missing=0, $div_id = "langselector"){ echo '<div id="'.$div_id.'"><ul>'; foreach($languages as $l){ echo '<li>'; if(!$l['active']) echo '<a href="'.$l['url'].'">'; echo '<img src="'.$l['country_flag_url'].'" alt="'.$l['language_code'].'" />'; if(!$l['active']) echo '</a>'; //if(!$l['active']) echo '<a href="'.$l['url'].'">'; // echo $l['native_name']; //if(!$l['active']) echo ' ('.$l['translated_name'].')'; //if(!$l['active']) echo '</a>'; echo '</li>'; } echo '</ul></div>'; } } }
URL: http://wpml.org/documentation/support/creating-multilingual-wordpress-themes/#language_switcher