Gavick child-themes?

April 2014 WordPress Theme
GK User
Sun Dec 21, 2014 7:31 pm
How Gavick templates work with child-themes?
I did as always, I create /John-Child folder and I stay within this folder the style.css file:
Code: Select all
/*
Theme Name: John Child
Template: John
Text Domain:  John-Child
Description:  Child theme for the John theme
*/
@import url("../../plugins/jetpack/modules/sharedaddy/sharing.css");
@import url("../John/style.css");

I write my styles in the style.css and sharing.css file, but don't work. :huh:
Thanks
User avatar
Expert Boarder

GK User
Mon Dec 22, 2014 9:05 am
Hello,
Please check the following article:
https://www.gavick.com/documentation/wo ... ild-themes

If you want to use one css file for your modifications, please enable use override.css option from Template Options -> Advanced tab and copy or create override.css file in your John-child/css directory.
Please use the same directory structure.
You can copy and change also other css and php files (with the same directory structure like in original John theme).
This code "@import url("../John/style.css");" doesn't work, because there's no css inside the John/style.css, all css files are inside the css directory.
User avatar
Moderator

GK User
Mon Dec 22, 2014 2:07 pm
Hi!
I had already enabled the override.css panel, but does not work.
My procedure works correctly on any wordpress theme, so why not work with Gavick?
Why don't work "amount url"?
Before ask, I read the documentation Gavick, but this is insufficient.
The thing is that this does not work and I need urgent help!
User avatar
Expert Boarder

GK User
Mon Dec 22, 2014 8:03 pm
I have repeated the whole process from scratch and override.css worked, thanks. :laugh:

How could I add a stylesheet only for homepage?
It's possible working with child-themes?

Thanks :)
User avatar
Expert Boarder

GK User
Tue Dec 23, 2014 8:52 am
If you want to change the css only for the homepage, you should use .home class before your css selectors.
I.e.:
Code: Select all
.home h1 { .. }

for all h1 headers on the frontpage.

Regarding the child themes, of course you can use it, but themes like John uses our GavernWP framework and there will be small difference, please notice that in the John (parent) theme style.css file there's no css rules at all (all css are placed in the John/css directory), so if you want to change css files or add your own css file, you should copy these files into John-Child/css directory (only the files which you want to change, and a the bottom you can add your own css rules).
Generally in you Child Theme all css files are loaded from the parent but if you have file with the same name and in the same directory i.e. John-Child/css/override.css, this file from the child directory will be loaded.
User avatar
Moderator

GK User
Tue Dec 23, 2014 6:07 pm
Yes, I know I can call the class .frontpage or the class .home of the <body>.

But it is possible to do it from php?
I create different files (home.css, page.css, archive.css and single.css) and load them using php?
Something like if(home){} or if(!home){} or something similar?

Leaving content filtering, if I want to load a stylesheet that there is no father theme (animations.css), as I do? import url()?

Gracies. :)
User avatar
Expert Boarder

GK User
Tue Dec 23, 2014 11:49 pm
Hi,
Yes, you can import url with another css, but please do it in the file which is already loaded in your child theme (in John-child/css/...)
Regarding the css loading from php files, yes it's possible using conditional tags:

Code: Select all
if(is_home()) {
// load your css
}

or
Code: Select all
if(is_front_page()) {

}

Depends on the frontpage you are using, please check the documentation:
http://codex.wordpress.org/Conditional_Tags
User avatar
Moderator

GK User
Wed Dec 24, 2014 1:54 am
Thanks! This greatly help me :)
User avatar
Expert Boarder


cron