WordPress.org

Ready to get started?Download WordPress

Forums

Glossy Stylo
Child theme not working (11 posts)

  1. Janus Andersen
    Member
    Posted 11 months ago #

    I'm trying to make a few ajustments to Glossy Stylo, but I can't seem to get the child theme to work. Whatever styles I apply in the new style sheet (in the child directory).

    The child style.css looks like this:

    /*
    Theme Name: glossy-child
    Template: glossy-stylo
    */
    @import url("../glossy-stylo/style.css");
    h1, h2, h3 {color:#FF0000;}

  2. psurch
    Member
    Posted 10 months ago #

    I'm using a child-theme successfully using this at top of my child style.css
    /*
    Theme Name: Glossy Stylo Child
    Description: Child theme for the Glossy Stylo theme
    Template: glossy-stylo
    Version: 0.1.0
    */
    /* import parent theme style */
    @import url("../glossy-stylo/style.css");

  3. IAmTam
    Member
    Posted 8 months ago #

    I am having the same problem. I have what psurch has for my child theme header. It's not that the child theme overall is not working. It's that the child style sheet will not over ride the original style sheet. If anyone finds a solution, let us know.

  4. WPyogi
    Volunteer Moderator
    Posted 8 months ago #

    @IAmTam - there's no way to help with CSS questions without seeing your actual site.

  5. IAmTam
    Member
    Posted 8 months ago #

    Quick response! Thank you.

    I tried to change the original style sheet too but it did not work.

    Here is my site:
    http://ohholynightlyrics.com/

    I was just trying to change the font for the site title and description.

  6. WPyogi
    Volunteer Moderator
    Posted 8 months ago #

    For sure, don't modify theme files - as your changes will be lost when the theme is updated. Right now, you don't have a child theme active on your site - did you activate it? If you only want to make CSS changes you could use a Custom CSS plugin. Then try adding this CSS - and change the font to what you want:

    #header h1 {
        font-family: arial;
    }
    
    #headerimg .description {
        font-family: arial;
    }

    Be sure to clear your browser cache after making any changes.

  7. IAmTam
    Member
    Posted 8 months ago #

    Yes, under "theme" it shows my current theme as "Glossy Stylo-Child." Although I don't remember activating it. It just automatically happened after I uploaded my child theme file to my server. Hum. I'm not sure what's going on but it is probably something simple that I'm not seeing.

    Thank you for your help.

  8. IAmTam
    Member
    Posted 8 months ago #

    I am going to try activating a different theme, and then re-activate the child theme and see if that works.

  9. IAmTam
    Member
    Posted 8 months ago #

    Sorry to post again...I double checked everything. Everything looks right but my child theme style.css file is not overriding the parent theme's style.css file.

    I have this at the top of my child style sheet:

    /*
    Theme Name: Glossy Stylo Child
    Description: Child theme for the Glossy Stylo theme
    Template: glossy-stylo
    Version: 0.1.0
    */
    
    /* import parent theme style */
    @import url("../glossy-stylo/style.css");

    Can you see any mistakes?

    When I use Firebug, I can make the (temporary) changes. But I just can't make them stick.

    Again, thank you for your help!

  10. psurch
    Member
    Posted 8 months ago #

    1. Make sure your folder structure is correct.
    themes
    > glossy-stylo
    > glossy-stylo-child
    2. Make sure your child theme is activated as your main theme
    3. When you load the site you'll notice your style sheet is loading from the parent theme not the child theme.
    href="http://ohholynightlyrics.com/wp-content/themes/glossy-stylo/style.css?ver=3.7.1"
    It should be
    href="http://ohholynightlyrics.com/wp-content/themes/glossy-stylo-child/style.css?ver=3.7.1"

  11. endellion
    Member
    Posted 7 months ago #

    I think I found a solution to this. In the "functions.php" is a section

    `/**
    * Load the style.css
    */

    add_action('wp_enqueue_scripts', 'mythemeprefix_styles');

    function mythemeprefix_styles(){
    wp_enqueue_style( 'css', get_template_directory_uri()() . '/style.css' );
    }`

    I changed get_template_directory_uri() to get_stylesheet_directory() and now it seems to be working correctly for me.

Reply

You must log in to post.

About this Theme

About this Topic