Skip to content

Instantly share code, notes, and snippets.

@renestalder
Last active September 30, 2015 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renestalder/17ebfe2d1b3c8fab32d4 to your computer and use it in GitHub Desktop.
Save renestalder/17ebfe2d1b3c8fab32d4 to your computer and use it in GitHub Desktop.
Translate WordPress theme via child theme
  1. Paste the code snipped in the functions.php of the child theme
  2. Add languagesfolder to your child theme and add translated language files
<?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