Forked from scarstens/wordpress.different-langauges.php
Created
October 3, 2017 11:16
-
-
Save DmitriyWebDev/73d8951378c963d1b82aab34175ac0c5 to your computer and use it in GitHub Desktop.
Setup different languages for WordPress admin and front end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment