WordPress theme front and admin in different languages


/ Published in: PHP
Save to your folder(s)

Use this in your functions.php
Sets one language for WP Admin and the other for front-end.


Copy this code and paste it in your HTML
  1. // must be called before "load_theme_domain"
  2. function set_my_locale($locale) {
  3.  
  4. $locale = ( is_admin() ) ? "en_US" : "it_IT";
  5. setlocale(LC_ALL, $local );
  6. return $locale;
  7.  
  8. }
  9. add_filter( 'locale', 'set_my_locale' );
  10. load_theme_textdomain( 'YOUR TEXT DOMAIN HERE', TEMPLATEPATH.'/languages' );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.