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, that you modified your homepage and changed the background color of your child theme, then the child theme will take all the other files from the parent theme. This way, whenever there is a new update your child theme, it will take all the 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 if 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 one 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 will see on 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 chema@open-classifieds.com
* License: Commercial
* Parent Theme: kamaleon
*/
Theme::$parent_theme = 'kamaleon';
Note that child themes only work with the PRO version because they use the same license , if you don’t have a PRO license yet get it now here