How to solve the problem of manually adding custom code again after upgrading the WordPress theme
Editor to share with you how to solve the problem of manually adding custom code again after upgrading the WordPress theme, I believe most people do not know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.
Children's shoes who often toss about the theme know that adding code to the theme function template functions.php can increase the modification function, but it is troublesome to add these codes again after upgrading the theme. Here is a small way to avoid the trouble of repeated operations.
Some children's shoes will think of doing a sub-theme to add custom code, the method of this article is much simpler than doing a sub-theme.
The principle is to make a plug-in by yourself, add custom code to it and enable it.
You might think, wow! No, it's a little complicated, but it's actually very simple. Create a new PHP file and add the following code to it: