× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Don't Directly Modify Standard Themes

David Brumbaugh
Aug 08, 2016
<p>It's very common to want to make very small modifications to the default themes that come with WordPress (TwentyTwelve, TwentySixteen etc.) or one of the themes you download from the WordPress.org theme repository.</p> <p>It's tempting to just make a direct change to the file ... and it works!  .... Until there's a security update, and then your change is lost.</p> <p>Instead of modifying the theme code directly, create a child theme: <a href="https://codex.wordpress.org/Child_Themes">https://codex.wordpress.org/Child_Themes</a></p> <p>This article gives a great overview on why you should use a child theme and how to do so:</p> <p><a href="https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/">https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/</a></p> <p>If for some reason you <em>still </em>don't want to create a child theme you do have an alternative.  If you don't want your changes to be lost when the theme updates,  you can change the name of the theme before you change the theme itself.  That effectively makes it a different theme and it won't get updated:</p> <p> </p> <pre><code class="language-php"><span style="color:rgb(112, 128, 144)">/* Theme Name: <em><strong>A New Name</strong></em> Theme URI: http://example.com/twenty-fifteen/ Description: <em><strong>A different theme made by changing twenty-fifteen</strong></em> Author: John Doe Author URI: http://example.com Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready */</span></code></pre>
comments powered by Disqus