Function: the_curlang()

return the current language (slug) of a webpage: useful for theme’s developer

example of use to subselect a navigation menu in a child of twentyten :

 if ( "en_us" == the_curlang() ) {
  wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); 
 } else {
  wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primaire' ) );

In this example, the theme offers a way to have for users a specific navigation menu for target languages.
the return value is available just before to build the webpage after the wp_query.

more functions in plugin’s source (at end) and here in one table.

Ce contenu a été publié dans xili-language, avec comme mot(s)-clé(s) , , . Vous pouvez le mettre en favoris avec ce permalien.