Skip to main content

Tips and guide to edit a Theme

On this post, I will explain how to customize stock themes (pre-installed themes)

There is a problem if you modify stock or default themes, you script or files will be overridden if there are a update file for it. So, your changes will be gone and back to default.

This can’t be avoidable, except if you duplicate theme folder and create your own version (Change theme name, id.etc), but you will not get any official theme update.

Since v1.0.6 (Theme version), there are a custom script files, you can put your custom scripts here without worrying about overridden update, so you can keep your theme up to date.

Custom files:

  1. THEME FOLDER/includes/custom.php

custom.php can be used to store custom Widgets or any custom php scripts

2. THEME FOLDER/js/custom.js

custom.js can be used to store your custom javascript, custom.js is loaded from footer.php

3. THEME FOLDER/style/custom.css

You can override default style with custom.css, so you dont need to modify default css to avoid losing changes during update.

What about other part of theme ? home, header, footer, sidebar.etc ? You can modify it, there is no theme restriction, but for stock themes, you can potentially losing your script changes during theme update.

Theme is a full code, currently there is no UI editor of it

You can edit theme code easily with “Theme Editor” plugin, you can install it from Plugin repository, or use your FTP