admin管理员组

文章数量:1420166

Im looking to edit a parent theme, and not just the functions and style files. I find that child themes don’t have the flexibility i want. How can i edit the parent theme without all the risk and the possibility of an update overriding all my changes?

Im looking to edit a parent theme, and not just the functions and style files. I find that child themes don’t have the flexibility i want. How can i edit the parent theme without all the risk and the possibility of an update overriding all my changes?

Share Improve this question asked Jul 13, 2019 at 19:53 Luke AnglinLuke Anglin 51 bronze badge 1
  • Could you ellaborate on how child themes don't have the flexibility you want, please? In which way you find that they are lacking flexibility? – Antti Koskinen Commented Jul 13, 2019 at 20:46
Add a comment  | 

2 Answers 2

Reset to default 0

In short: Not easily.

First - just to say it: with child themes you can hook into functions, filter values, change templates or even exchange javascript files. This is usually enough.

Edit based on the comments: If the theme is coded with best practices and checks for child theme directory you may just copy the template from the parent theme to the child theme and do your changes there.

If child theme is not enough you have two possibilities:

  1. Write down your changes manually or backup the files. Once you update the theme reproduce the steps.

  2. Connect to your server with ssh. Install a git in the themes folder (or root if you need to). Check in your changes. Whenever you update the theme git merge the changes into the updated theme. Git is nothing for beginners. Make sure to backup your complete installation before experimenting with git.

There's no other solution imho.

Just rename the the theme folder. This essentially makes it a new theme, so it will no longer receive updates for the original theme, but you can safely make changes to it.

本文标签: Changing a parent theme safely