admin管理员组文章数量:1336331
I recently had a problem with my theme due to a plugin. Now its solved but people have been telling me since the problem arrived that i should create a child theme after the prob is solved.
In fact, the theme i bought already has a child theme in its documentation BUT I SOMEHOW FORGOT TO USE IT and was using the parent theme all the while and have been making changes to the parent theme for like 2 months now. Moreover, i have updated the theme for a couple of times as well during that period.
Now my question is: How to add child theme in place of parent theme after using the parent theme till now?
I recently had a problem with my theme due to a plugin. Now its solved but people have been telling me since the problem arrived that i should create a child theme after the prob is solved.
In fact, the theme i bought already has a child theme in its documentation BUT I SOMEHOW FORGOT TO USE IT and was using the parent theme all the while and have been making changes to the parent theme for like 2 months now. Moreover, i have updated the theme for a couple of times as well during that period.
Now my question is: How to add child theme in place of parent theme after using the parent theme till now?
Share Improve this question edited Apr 6, 2017 at 6:00 Mark Kaplun 23.8k7 gold badges43 silver badges65 bronze badges asked Apr 6, 2017 at 5:42 kshitij kuldeepkshitij kuldeep 191 silver badge2 bronze badges 1- Time duration of using parent theme has nothing to do with child theme. You can create child theme any time with minimum of only one file (style.css). A simple google search will tell you, how to create child theme in wordpress. – Rishabh Commented Apr 6, 2017 at 6:01
2 Answers
Reset to default 2Using child themes is a myth that you can live without. If you lived with modifying the parent theme all this time, there is no advantage in switching to use a child theme.
The implied promise of using a child theme is that you will be able to upgrade the parent theme without needing to redo your customizations. Unfortunately, most theme authors do not understand that this imposes a limitation on the amount of changes they should do in the parent theme when releasing a new version, and many times still release versions that break customization even when done in child theme, and this makes the whole concept break.
IMO a better alternative to child theme is to track the changes you have done in git, and when you need to do an upgrade of the base theme, you "just" merge your changes with the ones introduced in the new version.
base on question i think you want to know how to create child theme in wordpress.
I will share you below the steps for that and reference link too.
Here is my reference link Click Here
steps are given below to create child theme
// You need to add one folder in theme folder like following parent theme name test then make child theme as test-child // then create style.css file in that child folder and add following code. /* Theme Name: Twenty Seventeen child // your child theme name Template: twentyseventeen // parent theme name here */ // once this done add function.php file that override parent theme functionality and add following lines in that. add_action( 'wp_enqueue_scripts', 'AddParentTheme' ); function AddParentTheme() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
and you theme is ready, now save both file and check in appereance your child theme is there.
Thanks and hope you get idea using this.
本文标签: How to add child theme after using parent theme for long
版权声明:本文标题:How to add child theme after using parent theme for long 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742337166a2455856.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论