Skip to content

Instantly share code, notes, and snippets.

@wickywills
Created December 18, 2018 14:03
Show Gist options
  • Save wickywills/c7367c54d0583e4c2e909db41cad33be to your computer and use it in GitHub Desktop.
Save wickywills/c7367c54d0583e4c2e909db41cad33be to your computer and use it in GitHub Desktop.
Step 1:
Add `languages` directory to your theme
Step 2:
Download correct `.mo` file into the `languages` directory you created
Step 3:
Generate `.po` file from the `.mo` file using PoEdit
Step 4 (if using child theme):
Add in the following to your `functions.php` file, changing the name for the parent theme:
```
// Load translation files from your child theme instead of the parent theme
function my_child_theme_locale() {
load_child_theme_textdomain( 'YOUR-PARENT-THEME', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'my_child_theme_locale' );
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment