{"id":838099,"date":"2016-03-15T16:45:00","date_gmt":"2016-03-15T16:45:00","guid":{"rendered":"https:\/\/wpml.org\/?p=838099"},"modified":"2016-06-06T11:44:04","modified_gmt":"2016-06-06T11:44:04","slug":"create-multilingual-child-theme","status":"publish","type":"post","link":"https:\/\/wpml.org\/ko\/compatibility\/2016\/03\/create-multilingual-child-theme\/","title":{"rendered":"How to Create a Multilingual Child Theme?"},"content":{"rendered":"<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/wpml.org\/wp-content\/uploads\/2016\/03\/create-a-multilingual-child-theme.png\" alt=\"create a multilingual child theme\" width=\"675\" height=\"205\" \/><\/p>\n<h2>Introduction<\/h2>\n<p>If you are new to WordPress, you might wonder why you should create a child theme. Well, there are a couple of reasons why you would want to do that; the most important one being that if you applied modifications to the theme files directly and the theme is updated, you will lose these modifications.<\/p>\n<p>Creating a child theme is not rocket science. All you need to do is create a child theme directory inside the theme\u2019s folder, add the style.css and functions.php files to it, and add the language configuration file. In this tutorial we will explain in details how to create a multilingual child theme for <a href=\"http:\/\/my.studiopress.com\/themes\/genesis\/\">Genesis<\/a> theme as an example. The same steps can be followed to create a child theme for other themes.<\/p>\n<h2>Steps<\/h2>\n<ol>\n<li>Create a child theme directory, which will be placed in wp-content\/themes. A couple of things to note:<\/li>\n<\/ol>\n<ul>\n<li>It is recommended that the name of your child theme directory is appended with \u201c-child\u201d.<\/li>\n<li>Do not insert spaces when naming your child theme directory as it might create errors. See the following illustration.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/wpml.org\/wp-content\/uploads\/2016\/03\/create-child-theme-folder.png\"><img decoding=\"async\" src=\"https:\/\/wpml.org\/wp-content\/uploads\/2016\/03\/create-child-theme-folder.png\" alt=\"create child theme folder\" width=\"139\" height=\"104\" \/><\/a><\/p>\n<ol start=\"2\">\n<li>Create a stylesheet for the child theme (style.css file); this file will be placed inside the child theme folder that you created. The stylesheet must begin with the stylesheet header, which contains information such as child theme name, child theme URL, Description, and Template, etc&#8230;).<\/li>\n<\/ol>\n<p>Note that for Genesis theme it is not recommended to import\u00a0the style.css file from the Genesis Framework since they\u00a0change the design from time to time. instead you can download\u00a0Genesis Sample child theme available for from your\u00a0account and at https:\/\/github.com\/copyblogger\/genesis-sample<br \/>\nIt looks just like Genesis, but can be used without importing the parent stylesheet since it includes one. For other themes you can follow the provided steps to add the stylesheet to your child theme.\u00a0See the following example.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\/*\r\nTheme Name: Genesis Child\r\nDescription: Child Theme for Genesis\r\nAuthor: XYZ\r\nTemplate: genesis\r\nText Domain: genesis\r\n*\/<\/pre>\n<p>Replace the example text with details relevant to your theme. A couple of things to mention here:<\/p>\n<ul>\n<li>The template line corresponds to the directory name of the parent theme.<\/li>\n<li>It is a good practice to add your theme text domain, which is used to denote all text belonging to the theme.<\/li>\n<\/ul>\n<ol start=\"3\">\n<li>Now, it is time to inherit the styles from the parent theme. This can be done by creating the functions.php file inside the child theme directory; then, copy and paste the code below.<\/li>\n<\/ol>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;?php\r\n \r\nfunction custom_enqueue_child_theme_style() {\r\nwp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '\/style.css' );\r\n}\r\nadd_action( 'wp_enqueue_scripts', 'custom_enqueue_child_theme_style' );<\/pre>\n<ol start=\"4\">\n<li>At this point, you can activate your child theme by navigating to WordPress dashboard &gt;&gt; Appearance &gt;&gt; Themes.<\/li>\n<li>Add a language configuration file to your child theme, you can download\u00a0a sample language configuration file from <a href=\"https:\/\/d2salfytceyqoe.cloudfront.net\/wp-content\/uploads\/2010\/10\/wpml-config.zip\">here<\/a> and place it in the child theme directory. The language configuration file is used to denote what needs to be translated in the theme.\u00a0Read about <a href=\"https:\/\/wpml.org\/documentation\/support\/language-configuration-files\/\">language configuration file<\/a>. Note that you will need to delete the language configuration file for you parent theme and keep the one for the child theme because keeping both files would create errors. Now, your child theme directory should look something like this.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/wpml.org\/wp-content\/uploads\/2016\/03\/files-in-child-theme-folder.png\"><img decoding=\"async\" src=\"https:\/\/wpml.org\/wp-content\/uploads\/2016\/03\/files-in-child-theme-folder.png\" alt=\"files in child theme folder\" width=\"116\" height=\"66\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>Child themes allow you to apply modifications to your theme without altering the parent theme, which will keep your code organized and prevent theme updates from changing your modifications. By following the instructions in this tutorial, you can create a child theme in just a few minutes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction If you are new to WordPress, you might wonder why you should create a child theme. Well, there are a couple of reasons why you would want to do that; the most important one being that if you applied modifications to the theme files directly and the theme is updated, you will lose these [&hellip;]<\/p>\n","protected":false},"author":76577,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"ep_exclude_from_search":false,"footnotes":""},"categories":[1371,8],"tags":[],"class_list":["post-838099","post","type-post","status-publish","format-standard","hentry","category-compatibility","category-tutorials"],"_links":{"self":[{"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/posts\/838099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/users\/76577"}],"replies":[{"embeddable":true,"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/comments?post=838099"}],"version-history":[{"count":9,"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/posts\/838099\/revisions"}],"predecessor-version":[{"id":898014,"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/posts\/838099\/revisions\/898014"}],"wp:attachment":[{"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/media?parent=838099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/categories?post=838099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpml.org\/ko\/wp-json\/wp\/v2\/tags?post=838099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}