fbpx
How to Use Separate Languages for WordPress Admin and Website

How to Use Separate Languages for WordPress Admin and Website

Define one language for the WordPress admin section and another language for the website.
*Note – for this to work you must not define WPLANG in your wp-config.php file.

Instructions
Add this code to your functions.php file

// 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' );

WordPress Snippet Info

Tested with Wordpress v. 4.8
Last Modified: 15.05.2017
Last Reviewed: 15.05.2017

How to Use Separate Languages for WordPress Admin and Website
4.7 (94.29%) 14 vote[s]
Please report broken snippets.
Report Broken Snippet

Recent Comments