Move custom code out of theme’s functions.php file

In previous questions you mentioned that you created a child theme and installed the multiple themes plugin so that you could put code on a specific page on your site. So you’ve been using child themes in a way that they weren’t intended to be used.

Instead, think of a child theme as a transparency, a layer over the top of your theme. You create a child theme, and place custom code in it, then activate that child theme instead of the theme you were using. WP will load both themes, preferring the template files in the child theme.

This way, because all your changes are in the child theme, when the parent theme is updated no loss occurs.

Leave a Comment