最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

changing parent theme into child theme

programmeradmin2浏览0评论

I inherited a site that didn't use a child theme, and now it needs to be updated. Can I take the original parent theme, change the style sheet header, copy it into the root, delete everything but wp-content and make it be the child theme? In the past, I've loaded any files I wanted from the parent into the child theme, and it is my understanding that the browser will prefer whatever's in the child theme.

I inherited a site that didn't use a child theme, and now it needs to be updated. Can I take the original parent theme, change the style sheet header, copy it into the root, delete everything but wp-content and make it be the child theme? In the past, I've loaded any files I wanted from the parent into the child theme, and it is my understanding that the browser will prefer whatever's in the child theme.

Share Improve this question asked Apr 22, 2020 at 19:19 plushjudyplushjudy 211 silver badge6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -2

That is 100% the approach you should take. You can even set up the child theme with a folder your-child-theme-name/ and then a style.css which uses the parent as the template:

template: your-parent-theme-folder

Then, you can either import the styles into this style.css (@import url('../parent-theme-folder/style.css')) or start from scratch as needed.

You'll also be able to pull in files you want to edit (like header.php or footer.php).

Additional reading:

  • https://www.smashingmagazine/2016/01/create-customize-wordpress-child-theme/
  • https://developer.wordpress/themes/advanced-topics/child-themes/
  • https://www.hostinger/tutorials/how-to-create-wordpress-child-theme
发布评论

评论列表(0)

  1. 暂无评论