- Paste the code snipped in the functions.php of the child theme
- Add
languages
folder to your child theme and add translated language files
Last active
September 30, 2015 13:45
-
-
Save renestalder/17ebfe2d1b3c8fab32d4 to your computer and use it in GitHub Desktop.
Translate WordPress theme via child theme
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
<?php | |
// Load translation files from your child theme instead of the parent theme | |
add_action( 'after_setup_theme', function () { | |
// load custom translation file for the parent theme | |
load_theme_textdomain( 'parent-theme-textdomain', get_stylesheet_directory() . '/languages' ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment