I was trying to modify a template to should use a Child-theme (using WordPress) so, when parent template updates I wont lose my changes. Well, the problem is that I created a template using parts of other templates. I was thinking about set my style and all like that, but maybe I missed some update command and if any parent template will get an update I might lose all my work.
How can I be completely sure to not add any information about updates on my customized template??
Thanks
Increase the version number in the style.css to something really high, and you should stop getting the update notices.
Open the style.css file and change the theme name and information that is in the comment at the top. This will essentially turn your theme into a child theme and no updates will affect it.
if you want to do something clean follow these steps:
done, it will no longer compare the original theme with the wordpress themes directory, so it will not find any updates.
in style.css on top portion just change the version to Version: 9.9.9 and it will do the job straight away.
Remove this line from
wp-config.php
:Have a look at this article for more details.
Instead of simply modifying the style.css file of the theme as other answers suggest, I would recommend taking full advantage of child themes. This way, it is possible to update the main theme (e.g. if security vulnerabilities are found or you just prefer to have the latest version) and also retain all of your modifications.
For example, if you want to modify the Twenty Fifteen theme, create a new directory
/wp-content/themes/twentyfifteen-child/
* and in this directory you need astyle.css
file with the following:Modify accordingly. You can put whatever you want for anything, except the
Template
line, which must be the same as the directory name of the parent theme. When using child themes, it will load any of the files in your new theme directory in addition to the ones in the parent theme. Specifically,styles.css
in the child theme is loaded after the one in the parent theme andfunctions.php
in the child theme is loaded before the functions.php in the parent theme. Any and all modifications to the theme would then be done to the files in the newly createdtwentyfifteen-child
directory.* This directory can be called anything that you want, but this naming style is recommended since will make it obvious which theme is the parent.
This code execute once wp loaded
Using a child theme is the first step – updating the main theme won´t affect your changes.
Nevertheless it is not sufficient to use a child theme to prevent (accidental) updates, because there is a severe bug in the wordpress update-routine: WordPress first checks whether there is a theme with the same name and a higher version number in the WordPress repository. If so, it will be offered and imported as an update. It does not matter whether the theme in question is a child theme!
There are two ways that you can work around the problem:
Add following line in wp-config.php file