This guide is only for Yclas Self Hosted!
Note: This guide is for advanced users
When creating a classifieds website you may want to apply a couple of changes to the design, which is why we added child themes to our classified script. This means you can make these changes using the same Yclas license you have for your premium theme.
Child themes enable you to create a theme that takes all the files from your premium theme except for the files that you modified, so lets say for example you modified your homepage and changed the background color at your child theme, then the child theme will take all other files from the parent theme, and this way whenever there is a new update your child theme will take all updated files from the parent theme when it’s updated except for the files that you modified.
This guide is the third of its kind after the first guide on understanding Yclas themes and second guide on how to modify or create yclas themes, I recommend you read those two guides as well when you want to modify your site with our classifieds script.
Why use child themes in a classifieds script
There are a couple of reasons why you should use child themes when applying modifications:
- When you modify an existing theme and a new release with an update to that theme comes out, it’s very complex to update that theme. But a child theme would be updated automatically when the parent is updated.
- It is the best way to start learning how to customize yclas themes.
- Child themes use the same license as their parent theme
- It will save you development time
How to use child themes
- Go to your FTP or file manager, navigate to /themes/
- Create a new folder there with a name you choose for your child theme
- Navigate to the parent theme that you want to do modifications on
- Copy the init.php file and paste it in your child theme folder
- Paste the below code in the top of your init.php file
- Login to your admin panel
- Activate your child theme
Here is an example of what you would see in your child theme init.php file:
* Theme Name: ChildTheme
* Description: Our latest great theme with 14 different styles/color schemes included and multiple options of configuration.
* Tags: HTML5, Responsive, Mobile, Premium, Admin Themes, Advanced Configuration, prettyPhoto, Slider.
* Version: 1.6
* Author: Chema firstname.lastname@example.org
* License: Commercial
* Parent Theme: kamaleon
Theme::$parent_theme = 'kamaleon';
Note that child themes only work with premium themes because they use the same license as the premium theme, if you don’t have a premium theme yet get it now with a small fee of 3.49$ a month