Skip to content

Instantly share code, notes, and snippets.

@renestalder
Last active September 30, 2015 13:45
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