Skip to content

Instantly share code, notes, and snippets.

@geoffreycrofte
Created May 30, 2014 08:53
Show Gist options
  • Save geoffreycrofte/e372a1a047024cd9e023 to your computer and use it in GitHub Desktop.
Save geoffreycrofte/e372a1a047024cd9e023 to your computer and use it in GitHub Desktop.
Translation for a WordPress Child Theme
<?php
/*
CHILD THEME functions.php file
*/
if ( !function_exists('child_localization')) {
function child_localization() {
load_child_theme_textdomain('child_text_domain', get_stylesheet_directory() . '/lang');
}
add_action('after_setup_theme', 'child_localization');
}
// useful debug tool : http://marketpress.com/product/debug-translations/
// thank you @jennybeaumont ;)
<?php
/*
PARENT THEME functions.php file
*/
if ( !function_exists('parent_localization')) {
function parent_localization() {
load_theme_textdomain('parent_text_domain', get_template_directory() . '/languages');
}
add_action('after_setup_theme', 'parent_localization');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment