• Resolved createitcafe

    (@createitcafe)


    I am not able to see the changes that I’ve made in the child theme style.css. I’ve activated my child theme for Optimizer Pro 3.8. I’ve tried many of the suggestions in the wordpress forums and I’m not having any luck. I’m using XAMPP on my local laptop. Any ideas? Below is my child style.css

    Theme Name:  CIT
    Description:  Create IT Consulting, LLC magnificent child theme
    Author:  Create IT Consulting, LLC.   Jessica Rhoades
    Version:  1.0
    Template:  Optimizer_pro
    */
    
    /*@import url('../optimizer_pro/style.css');  - no longer used due to caching issues
    
    */
    <?php
    function theme_enqueue_styles() {
    
        $parent_style = 'parent-style';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
        );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    
    /*
    body {
        border: 10px solid red !important;
    }
    */
    
    /* Contact Form 7 Styles
    ---------------------------------*/
    .wpcf7 {
    background-color: #F1F1F1;
    border: 25px solid #666666;
    }
    
    .wpcf7-form {
    margin-left: 25px;
    margin-right: 25px;
    margin-top: 25px;
    }
    
    .wpcf7-textarea {
     width: 85%;
    }
    
    .wpcf7 input {
    width: 50%;
    }
    
    .wpcf7-text {
    width: 50%;
    border: 10px solid;
    }
    
    ?>

    This is my functions.php in my child theme.

    <?php
    
    function enqueue_parent_theme_style() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style', PHP_INT_MAX);
    }
    
    function enqueue_child_theme_style() {wp_enqueue_style( 'child-style', get_stylesheet_directory_uri().'/style.css' );}
    add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_style', 100 );
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author OptimizerWP

    (@layerthemes)

    Thread Starter createitcafe

    (@createitcafe)

    I’m putting my resolution on here in case anyone else runs into this. It was driving me nuts as my changes to the stlye.css would not show up. I tried.

    1. Restarting Apache Web Services
    2. Closing the web browser
    3. Deleting the specific page out of the cache in the web browser history
    4. Rebooting the laptop

    None of the above showed my style.css changes. Then days later all of a sudden my changes would show up. I’m still not sure what the true issue is.

    BUT the problem seems to be with the Chrome Browser (which is what I usually use). I switched to Safari and whalah! Anytime I change my style.css, the changes show up. Hope this helps someone in the future.

    Kind regards,

    Theme Author OptimizerWP

    (@layerthemes)

    @createitcafe Sounds like you are chrome is saving cookie for longer period of time. After making the changes, press ctrl+f5 and it will clear the browser cache and you will see the change immediately.

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Child Theme style.css not working’ is closed to new replies.