Meet GavernWP supported now Child Themes

Meet GavernWP v.1.6 provides full support for the Child Themes mechanism. Our users now have the ability to modify a theme without worrying that the theme update will clear out the changes.

Child Themes

Implementation of Child Themes support is associated with two functions:

  • gavern_file_uri – returns the URI to a specific file relative to the root of the theme directory
  • gavern_file_path – returns the absolute path to a specific file relative to the root of the theme directory

Both functions accept false as an argument – these functions will then return the URI/path to the specific theme directory. IMPORTANT! Please remember to not use the slash at the start of the file path.

In example:

gavern_file_uri('images/abc.png');

The above example will return:

http://yourdomain.com/wp-content/themes/MeetGavernWP/images/abc.png

and using the false argument:

gavern_file_uri(false);

This example will return:

http://yourdomain.com/wp-content/themes/MeetGavernWP/

You can now override every file in your Child Theme! Please keep in mind certain dependencies.

In the example, you can copy the template.css file and change it, but then you will also need to import the images directory to your Child Theme because the theme will use the CSS from the Child Theme’s directory, which itself links to the images directory in the Child Theme’s directory.

OK, but what if you want to add some CSS or PHP code, without using original files? Remember that if you override a file, then you must add modifications manually if they will be added in the theme during update.

In this case you can use two files:

  • css/override.css – for your own CSS code (remember to enable this file in the theme’s Advanced settings tab)
  • gavern/user.functions.php – for your own PHP code With the above files, you needn’t worry about adding update changes to your overrided files.

The Child Themes support will be added to our premium themes on the nearest update.

Share
This article was first published February 27th, 2013