How to setup different admin and theme languages on your WordPress blog

Simply set the desired locale (on line 6) then add the code to your functions.php file.

<?php
     // setup one language for admin and the other for theme
     // must be called before load_theme_textdomain()

     function set_my_locale($locale) {
          $locale = ( is_admin() ) ? "en_US" : "it_IT";
          setlocale(LC_ALL, $local );
          return $locale;
     }
     add_filter( 'locale', 'set_my_locale' );
?>

Thanks to wp-snippet for the cool tip!

Leave a Reply

Your email address will not be published. Required fields are marked *