[Resolved] Child Theme Styles not working

Home Forums Support Child Theme Styles not working

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #135421
    Lynn

    Hi there,

    Any help here would be greatly appreciated!!!

    I am using the generate press wordpress theme with the add on bundle. I manually installed my own child theme. I have been utilizing the add ons to modify fonts and colors, but I would like to alter certain style elements in my css. Some of which are not working — even when I use the !important tag.

    I have tested the css file to make sure it is working by changing the background color of the whole body tag to a bright red, this worked like a charm. But when I try to alter the margin below the widget title, nothing changes.

    .widget-title {
    margin-bottom: 10px !important;
    }

    When I modify it in the developer tools it works, but when I put it in the style sheet there is not change.

    My functions.php looks like this:

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }

    Any thoughts? Thank you in advance.

    #135437
    bdbrown

    Hi Lynn. You don’t need to enqueue the parent style sheet; the theme loads it automatically. First thing to try is removing that function and see if that helps. If not, please post a link to your site so we can take a look at what’s happening. Thanks.

    #135470
    Tom
    Lead Developer
    Lead Developer

    Removing that function should do the trick 🙂

    #135521
    Lynn

    Thanks! I will give it a try, I am not able to fiddle with it at this very moment. I was following the wordpress.org instructions on creating a child theme as it was stated that the @import option in the css file is no longer the best practice. Therefore I do not have that in the style sheet. I am assuming I have to add it? I will let you know what happens.

    I also might add I am using the page builder by site origin plugin. Are you aware of any issues with this plugin and child themes?

    Thank you so much for your quick response. This is a great theme!

    Lynn

    #135534
    bdbrown

    True, the @import option is no longer recommended. But you don’t need to add it; the theme includes code to load the parent style sheet automatically. I haven’t used Page Builder but would check the plugin website support page or the WP plugin support forum to review any outstanding issues.

    #135661
    Lynn

    Hi again, Removing the function had no change on the site. I also deactivated the page builder to see if that was causing issues and nothing changed.

    Here is the link — totally in development.

    http://173.254.78.133/~debnars1/pools/in-ground-pools/

    But the main changes I am trying to make is the widget-title margin bottom. If I make a global change like changing the body background color it works, but not much else.

    Thanks again for you help. I am stumped.

    #135663
    bdbrown

    Hi Lynn Your style isn’t being applied because you’re missing a closing bracket in the code above it; all the styles after that are ignored:

    .page-content, .entry-content, .entry-summary {
        margin: .5em 0 0;
    }  <------------- this bracket is missing
    
    /*///////WIDGETS///////////*/
    /*///////WIDGETS///////////*/
    /*///////WIDGETS///////////*/
    
    .widget-title {
        margin-bottom: 0 !important;
    }
    

    Add that bracket and all your widget titles should adjust.

    #135672
    Lynn

    Oh my dear. I don’t know if I have ever felt so stupid in my life. And really I am not! Thank you for the second set of eyes. I stared at that for so long!
    I feel small right now. 🙂

    #135679
    bdbrown

    No problem 🙂 A second set of eyes is always good. We do peer code reviews at work all the time. It does help catch things that might otherwise be missed. Glad I could help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.