Home Forums Air WordPress Theme Custom css in child-theme not working

This topic contains 4 replies, has 2 voices, and was last updated by  panjijayasutra 2 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #13904

    panjijayasutra
    Participant

    I have successfully installed my child-theme. and activated it, but when i put my custom css code to file custom.css in folder air-theme-child , it does nothing.

    in the air-theme-child i have 4 files :
    – custom.css
    – function.php
    – screenshot.png
    – style.css

    Code in custom.css :
    .myc {
    color: red;
    background-color: yellow;
    }

    code in function.php:
    <?php
    function ux_frontend_styles() {
    wp_register_style(‘customstyle-css’, get_stylesheet_directory_uri() . ‘/custom.css’, array(), ‘1.0’, ‘screen’);
    wp_enqueue_style(‘customstyle-css’);
    }
    add_action(‘wp_enqueue_scripts’, ‘ux_frontend_styles’,102);
    ?>

    Code in style.css:
    /*
    Theme Name: Air Child Theme
    Theme URI: http://themeforest.net/user/bwsm/portfolio
    Description: A Child Theme for the Air WordPress Theme. If you plan to do a lot of file modifications we recommend to use this Theme instead of the original Theme. Updating wil be much easier then.
    Author: UXteam / Bwsm
    Author URI: http://www.uiueux.com
    Template: air-theme
    Version: 1.0
    */

    help me please, what is missing with my code ?
    thanks for help.

    #13911

    BWSM
    Keymaster

    Hi, please send your wp-admin(url/user/pass) via
    my profile contact form (you need login on ThemeForest), I’ll log in to check it.

    Regards!

    #13918

    panjijayasutra
    Participant

    Hii,
    Thanks for replay.
    But i still test it on my localhost computer. not in production.

    can you give me correct code format in file function.php at child-theme.

    Thanks for help.

    #13919

    BWSM
    Keymaster

    Hi

    Please click “view page source”, check if there is the custom.css, like
    <link rel='stylesheet' id='customstyle-css-css' href='http://localhost:8888/wordpress/wp-content/themes/air-child/custom.css?ver=1.0' type='text/css' media='screen' />

    Please make sure the origin theme(Air theme) folder name is: “air-theme

    Regards!

    #13924

    panjijayasutra
    Participant

    Hii,
    Thanks for replay,

    i have changed code file function.php in child-theme like this and work successfuly:

    
    <?php
    function use_parent_theme_stylesheet() {
        return get_template_directory_uri() . '/style.css';
    }
    function my_theme_styles() {
        $themeVersion = wp_get_theme()->get('Version');
        wp_enqueue_style('child-theme-style', get_stylesheet_directory_uri() . '/custom.css',
            array(), $themeVersion);
    }
    add_filter('stylesheet_uri', 'use_parent_theme_stylesheet');
    add_action('wp_enqueue_scripts', 'my_theme_styles', 20);
    
    ?>
    
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.