Posted By

mihael on 12/20/11


Tagged

wordpress language


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

dubogii
developer


WordPress theme front and admin in different languages


 / Published in: PHP
 

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

  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  

You need to login to post a comment.