admin管理员组文章数量:1304270
Every time storefront is being updated, my additional functions.php code is being removed.
How to prevent additional code in functions.php to be removed once there is an update?
Is there a plugin or is the only way to do it to create a child theme which in itself is a debug-worthy approach?
Every time storefront is being updated, my additional functions.php code is being removed.
How to prevent additional code in functions.php to be removed once there is an update?
Is there a plugin or is the only way to do it to create a child theme which in itself is a debug-worthy approach?
Share Improve this question asked Feb 14, 2021 at 10:05 Pascal WidmannPascal Widmann 1 1- What do you mean debug-worthy approach? – Rup Commented Feb 14, 2021 at 12:24
2 Answers
Reset to default 2There isn’t a way. You need to create a child theme or a plugin and put the functions there.
Note that there’s nothing special about child themes. The point is to put the code into something that somebody else isn’t going to update. So third party child themes aren’t safe either.
You can add a child theme of course, but I recommend you to use the Code Snippets plugin. Here you can add PHP which will run exactly like adding it to the child theme functions.php. However it is much more organised, and is retained once you make an update.
本文标签: pluginsHow to prevent additional code in functionsphp to be removed once there is an update
版权声明:本文标题:plugins - How to prevent additional code in functions.php to be removed once there is an update? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741750275a2395782.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论