Greeny Child Theme not showing correctly
-
I am trying to get a child theme to work with Greeny. However, when I activate the child theme the header and body baackground are not showing correctly.
You can view it here https://www.jdinsurance.com.au/wp/
https://www.ads-software.com/plugins/child-theme-configurator/
-
hardcab,
These settings are specific to the active theme.
Go to Appearance > Background and/or Appearance > Header and assign them again after you active the child theme.
Please see:
https://www.lilaeamedia.com/plugins/child-theme-configurator/#background_broken
Have tried all that and nothing works. Here is a screenshot of what the child theme looks like as opposed to the parent. Child Theme
Have asked on the authors forum but was just given the same tutorial to follow
This theme is using additional stylesheets.
Try importing them by adding this in the @imports tab:
@import url(../greeny/css/screen.css); @import url(../greeny/css/print.css);
You can also check “Scan parent theme for additional stylesheets” and re-import the theme. This will allow you to customize the above two stylesheets as well.
Let me know if you continue to have trouble.
Thanks,
-jf
yep have also tried adding the other style sheets and still looks the same
Well I have used the Duplicate Theme plugin and it all seems to be working fine
The Duplicate child theme works because it is copying the entire parent theme except for functions.php and styles.css.
While this appears to have solved your problem, it goes against the specification of child themes, which is to have a completely functional theme by importing the styles.css and only overriding specific templates and functions. Unfortunately a lot of commercial themes do not adhere to the www.ads-software.com spec for child themes: https://codex.www.ads-software.com/Child_Themes
Making the theme dependent on a local copy of the stylesheets that are required to load in a specific order breaks the model because any changes that occur in an upgrade will be lost.
Seeing that a complete copy of the parent theme files works indicates that the stylesheets are loaded by header.php. A more forward-compatible solution would be to update header.php so that it loads the parent stylesheets:
<link rel="stylesheet" href="<?php get_template_directory_uri(); ?>/css/screen.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="<?php get_template_directory_uri(); ?>/css/print.css" type="text/css" media="print" />
Or, in functions.php, change the function that enqueues the stylesheets:
wp_enqueue_style('core-stylesheets', get_template_directory_uri() . '/css/screen.css'); wp_enqueue_style('core-stylesheets-print', get_template_directory_uri() . '/css/print.css'); wp_enqueue_style('theme-stylesheet', get_stylesheet_uri());
Using get_template_directory_uri always references the parent so there is no need to actually copy the files.
Child Theme Configurator was developed to make customizing the parent stylesheet much easier than editing by hand. By simply making a copy of the parent theme verbatim you are missing out on a lot of the power CTC has to offer.
Please let me know if I can further help you in any way.
Thanks,
-jf
Well it seems that nothing I try works. I have tried the header but those lines are already there. I have tried the functions.php and the even the themes page gets all screwed up and I have asked on the theme designers forum and was told to follow the child theme tutorial.
I have since pasted a screenshot of what it looks like and have not been given an answer ??
This was supposed to be something simple that has turned into a major headache. I will just have to use the “Duplicate” theme and not worry about any updates
EDIT: BTW, I have tried making a child theme with catch-kathmandu and it works perfectly. It only seems that “Greeny” won’t work. And as I know absolutely nothing about PHP I don’t know how to get it to work
hardcab,
Sorry this has been such a chore.
catch-kathmandu works because it doen’t try to use additional ‘core’ stylesheets without loading them relative to the parent theme.
I have installed Greeny locally and as I said the problem is in header.php.
Using the “files” tab, select ‘header’ and click “copy selected to child theme.”
Next, click the link, “Click here to edit template files using the Theme Editor.” After the page loads, click the “Header” link on the right. Replace the following lines:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/screen.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/print.css" type="text/css" media="print" />
with these lines:
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/screen.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/print.css" type="text/css" media="print" />
Click “Update File” and the child theme will now load the ‘core’ stylesheets along with the new ‘styles.css’ file.
I’m sorry but I just don’t get it. As I said I know nothing about PHP. I have followed your instructions and created a child theme using Child Theme Configurator.
I have then clicked on the File tab and checked header.php to be copied to child theme.
However, when I click on “Click here to edit template files using the Theme Editor.” the file that opens is an empty header.
If I try to add the above lines I get an error on line 6 and nothing displays. If I try to copy the header file manually to the child theme and then edit and replace those lines I still get the error.
It appears that I am not meant to create a child theme for this theme even though I have purchased it.
Maybe all I can do is just stick to the duplicate theme and NOT worry about any updates etc because I am ready to smash my pc because this is so frustrating for me
EDIT: I have tried it again following everything step by step. I have noticed though that ALL the tabs ie Query/Selector, Rule?Value, @import etc are ALL empty unlike the instructions on your plugin page that say to select the files that you want to edit. In the child theme everything is blank
hardcab,
I can resolve this in five minutes with a temporary admin account. Please add an admin user and send the login to [email protected].
As soon as I am finished you can delete the account. It is important to us that you get this resolved.
Thanks,
-jf
sent
I have updated the header.php file and activated the greeny-jdi-child theme.
There were two additional line that needed to be changed:
<!--[if IE]><link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/ie.css" type="text/css" media="screen, projection"><![endif]--> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
changed to:
<!--[if IE]><link rel="stylesheet" href="<?php echo get_template_directory_uri();; ?>/css/ie.css" type="text/css" media="screen, projection"><![endif]--> <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
Let me know if you have additional questions.
Thanks,
-jf
I have checked your files compared to mine and other than the 2 additional lines everything else was the same. So if those 2 lines only affected IE then I don’t have a clue as to why mine was showing like it was in FF.
Thank you for all your help, it was very much appreciated
I’m sorry to be a pita but I have been asking on the greeny forum how to add a nav bar in the footer. Unfortunately they are not as helpful as here.
The theme comes with 2 menuu in the header but I am using only one. They have suggested that because I am not using the 2nd menu I can place it in the footer by putting the following code in the footer.
<div class=”navcontainer”>
<?php
if(function_exists(‘wp_nav_menu’)) {
wp_nav_menu( ‘depth=1&theme_location=footer&menu_id=nav&container=&fallback_footer_default’);
} else {
footer_default();
}function footer_default()
{
?>
<ul id=”nav”>
<li <?php if(is_home()) { echo ‘ class=”current-cat” ‘; } ?>>“>Home
<?php wp_list_categories(‘depth=1&hide_empty=0&orderby=name&order=ASC&title_li=’ ); ?><?php
}
?></div>
However, I want a menu bar like at the top and not a bullet style menu
Any suggestions?
Use CTC to create new styles for the footer menu. Unfortunately using CSS is beyond the scope of our support, but there are plenty of tutorials online.
Basically, find the selectors used by the menu and create override styles for those selectors. You can use the original menu styles as a starting point.
- The topic ‘Greeny Child Theme not showing correctly’ is closed to new replies.