Created
April 27, 2016 05:50
-
-
Save tenomoto/00a51401cfe1a96a612916264a863dbc to your computer and use it in GitHub Desktop.
Multilingual title and description in WordPress with bogo
This file contains 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
add_filter( 'option_blogname', 'tr_option_blogname' ); | |
function tr_option_blogname( $blogname ) { | |
return __($blogname, 'my-theme-child'); | |
} | |
add_filter( 'option_blogdescription', 'tr_option_blogdescription' ); | |
function tr_option_blogdescription( $blogdescription ) { | |
return __($blogdescription, 'my-theme-child'); | |
} | |
add_action( 'after_setup_theme', 'my_child_theme_setup' ); | |
function my_child_theme_setup(){ | |
load_child_theme_textdomain( 'my-theme-child', get_stylesheet_directory() . '/languages' ); | |
} |
This file contains 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
#: Site Title | |
msgid "English Title" | |
msgstr "日本語のタイトル" | |
#: Site Description | |
msgid "Description in English" | |
msgstr "日本語のキャッチフレーズ" |
This file contains 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
/* | |
Theme Name: My Theme Child | |
Description: My Theme Child Theme | |
Author: Jonh Doe | |
Author URI: http://www.example.com | |
Template: my-theme | |
Version: 1.0.0 | |
Tags: | |
Text Domain: my-theme-child | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment