Return to Snippet

Revision: 54308
at December 20, 2011 00:47 by mihael


Updated Code
// must be called before "load_theme_domain"
function set_my_locale($locale) {
	
	$locale = ( is_admin() ) ? "en_US" : "it_IT";
	setlocale(LC_ALL, $local );
	return $locale;

}
add_filter( 'locale', 'set_my_locale' );
load_theme_textdomain( 'YOUR TEXT DOMAIN HERE', TEMPLATEPATH.'/languages' );

Revision: 54307
at December 20, 2011 00:45 by mihael


Initial Code
// must be called before "load_theme_domain"
function set_my_locale($locale) {
	
	if( is_admin() )
	{
		$locale = "en_US";
	}
	else
	{
		$locale = "it_IT";
	}
	setlocale(LC_ALL, $local );
	return $locale;

}
add_filter( 'locale', 'set_my_locale' );
load_theme_textdomain( 'YOUR TEXT DOMAIN HERE', TEMPLATEPATH.'/languages' );

Initial URL

                                

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

Initial Title
WordPress theme front and admin in different languages

Initial Tags
wordpress

Initial Language
PHP