• I have the following code on top of my functions.php, taken from the child themes guide on wordpress:

    <?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    ?>

    But i’m not entirely sure if it’s correctly working as I have this code in my style.css:

    .main-navigation ul li a:before {
      display: none;
    }

    This is to remove the page icons next to links on my storefront-child theme but it’s currently not working. The other posts I have seen seems to be working with that solution. The only problem I can think of is that the style.css is not being loaded correctly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,
    Please share theme which you are using.
    Thanks.

    Thread Starter chipspice93

    (@chipspice93)

    Hi,
    Please share theme which you are using.
    Thanks.

    It is the storefront one but I am using a child theme.

    In my child theme I have:
    functions.php
    style.css

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If your Child theme wasn’t working then you’d know about it in an error message of some form.

    Thread Starter chipspice93

    (@chipspice93)

    If your Child theme wasn’t working then you’d know about it in an error message of some form.

    Yeah, my functions.php have been working and whenever it doesn’t there’s usually an error on the page but I am guessing it’s the same for the style.css?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yes. Your issue is that you’re not using specific enough selectors. If you use a web developer tool like the one built into Chrome, you can see that your selectors are slightly wrong and if they were corrected they wouldn’t be specific enough…

    .main-navigation ul.menu>li.menu-item-has-children>a:after, .main-navigation ul.menu>li.page_item_has_children>a:after, .main-navigation ul.nav-menu>li.menu-item-has-children>a:after, .main-navigation ul.nav-menu>li.page_item_has_children>a:after

    Hi,
    I think your child theme is working but you do not apply proper css.
    Please apply some other css on some other element.
    If its not work then make child theme from this method https://themify.me/docs/child-themes
    (Its working for me) Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I make sure that my child theme style.css is working?’ is closed to new replies.