Css Or Dynamic file in child theme - by hamdy

This topic has 6 replies, 2 voices, and was last updated 6 years, 6 months ago ago by Rose Tyler

  • Avatar: hamdy
    hamdy
    Participant
    June 18, 2018 at 21:23

    Hi,
    I use the child theme but it doesn’t work I tried to add few codes to style.css file and uploaded to server on child theme folder but it doesn’t work even to dynamic.css I cant find any change in the website.

    5 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 19, 2018 at 09:39

    Hello,

    Custom css should work fine from Theme Options > Custom css or style.css of the child theme.
    Have you cleared cache after adding the code?
    Please provide us with the code you added and site URL.

    Regards

    Avatar: hamdy
    hamdy
    Participant
    June 20, 2018 at 14:29

    Hi Yes of course, I do clear the cash and I use different browsers.
    In the attached file a screenshot for all details

    https://prnt.sc/jx64ez

    Function.php file
    ———————
    <?php add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘child-style’, get_stylesheet_uri(), array( ‘bootstrap’, ‘parent-style’ ) );
    wp_enqueue_style( ‘dynamic-css’, get_stylesheet_directory_uri() . ‘/dynamic.css’ );
    }

    Dynamic.css file
    —————–

    .header-top {

    background-color: #f80e0e;

    }

    Style.css file
    —————-is empty since I heard to use dynamic for more fast loading pages

    Also I have a question I have WMPL plugin to translate my website what if I want to use a custom CSS file for the translated language child theme how my code should be? and where to add the file.
    Thanks

    .

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 20, 2018 at 14:51

    You do not need to edit dynamic.css file, this file is used automatically once you add custom css in Theme Options. If you want to add the code in css file directly, please, use style.css file of the child theme.
    Also, change your code to:

    .header-type-17 .header-top {
         background-color: #f80e0e;
    }
    

    Also I have a question I have WMPL plugin to translate my website what if I want to use a custom CSS file for the translated language child theme how my code should be? and where to add the file.

    – simply add custom css code in style.css file of your child theme. Or do you mean that the custom code should affect not all site but only 1 language?

    Regards

    Avatar: hamdy
    hamdy
    Participant
    June 20, 2018 at 16:18

    Hi thank you
    I Do exactly as you mention before nothing has been updated I really want to know why this happened now the dynamic file is empty and style.css file has this code

    .header-type-17 .header-top {
    background-color: #f80e0e;
    }

    Nothing has been changed.

    – For the custom css code for language. Yes custom code affect on one language what do to ? thanks

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 21, 2018 at 07:51

    Hello,

    1. Please clear cache and check one more time https://prnt.sc/jxgk3s
    2. Add custom css code in style.css file of child theme, but like in this example:

    html[lang="en-US"] body header {
        background: red !important;
    }

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.