• pokercouch

    (@pokercouch)


    Hi,

    I have created a child theme for my astrid theme. I used the instructions here when I did so: https://codex.wordpress.org/Child_Themes .

    My stylesheet for my child theme looks like this:
    /*
    Theme Name: Astrid Child
    Template: astrid
    Author: aThemes
    Description: Astrid can help you to quickly create an awesome business website.
    Version: 1.14.1492029142
    Updated: 2017-04-12 20:32:22

    */
    hentry {
    background-color: #000;
    }

    My problem is that even if I add CSS there (like the background-color above) the changes does not apply on my site. The site is http://www.howtobookyourtrip.com

    If I choose to add it through “Edit CSS” and then “Additional CSS” it applies though. But it does not work if I put it directly in the stylesheet. Why on earth could that be? I have searched for hours and hours but I have no clue…

    Maybe something is wrong in my functions.php? It looks like this:

    <?php
    function my_theme_enqueue_styles() {

    $parent_style = ‘astrid-style’; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘astrid-child-style’,
    get_stylesheet_directory_uri() . ‘/style.css’,
    array( $parent_style ),
    wp_get_theme()->get(‘Version’)
    );
    }
    add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
    ?>

    Any help is very appreciated. I would like to be able to put things directly in the stylesheet instead of through “additional CSS”.

    Regards,

    Axel

    • This topic was modified 7 years ago by pokercouch.
    • This topic was modified 7 years ago by pokercouch.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Eddie

    (@eddietate)

    Have you tried hard refreshing?

    Hold CTRL and press F5. Also, try rearranging the stylesheets to load in opposite order.

    • This reply was modified 7 years ago by Eddie.
    wpservices

    (@wpservices)

    Try to open the site in an incognito window.

    Thread Starter pokercouch

    (@pokercouch)

    I have tried hard refreshing and also to open it in an incognito window. The changes in the stylesheet still don´t apply…

    I have this code in the stylesheet as a test code:

    hentry {
    background-color: #000;
    }

    Obviously I have tried other codes as well. No code in the stylesheet works, so it´s not that.

    How should I change the code to make the stylesheets load in oppposite order like you suggest?

    Eddie

    (@eddietate)

    I see in the source of your child theme css, here: that you have missed a fullstop.

    .hentry {
    background:#000;
    }
    • This reply was modified 7 years ago by Eddie.
    Thread Starter pokercouch

    (@pokercouch)

    I was 100% sure that I tried it with a full-stop before, but you are totally right. I changed it on your instructions and BOOM, it worked. BUT now I changed to:

    .hentry {
    background-color: #FFF;
    }

    And it doesn´t change back… Why? It should be updated straight away? I clear cashe but it still shows up with the code below even thought it´s not in the stylesheet anymore:

    .hentry {
    background: #000;
    }

    Eddie

    (@eddietate)

    Glad that worked 😀

    I can see it as black. Did you hard refresh? Hard refresh after all changes.

    If you have access to FTP, try modifying the stylesheet that way, too.

    • This reply was modified 7 years ago by Eddie.
    • This reply was modified 7 years ago by Eddie.
    Thread Starter pokercouch

    (@pokercouch)

    Yes, it´s black now even though it looks like this in the stylesheet:

    .hentry {
    background-color:#FFF;
    }

    This makes me a bit crazy.. Can´t see why it is still black. I have tried to hard refresh but nothing…

    Thread Starter pokercouch

    (@pokercouch)

    I´m not sure how I modify it with FTP.

    What I know though is that I changed to this after your correction and it got black:

    .hentry {
    background: #000;
    }

    Then I changed back to this but it didn´t get white:

    .hentry {
    background: #FFF;
    }

    I find this extremely strange.. Could it be some kind of delay?

    EDIT: Now it suddenly got white like 10 mins later, but when I change to black it doesn´t go black. I guess it will in 10 mins..
    EDIT 2: After 20+ mins it got black…

    • This reply was modified 7 years ago by pokercouch.
    • This reply was modified 7 years ago by pokercouch.
    • This reply was modified 7 years ago by pokercouch.
    • This reply was modified 7 years ago by pokercouch.
    Thread Starter pokercouch

    (@pokercouch)

    All this makes me think it´s a case of server-side caching. I´ll look into it! Thank you for your help. I feel one step closer!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘CSS changes to stylesheet not working’ is closed to new replies.