hero image

Child theme CSS not working

Home Forums WordPress Themes Skywalker Child theme CSS not working

Forums WordPress Themes Skywalker Child theme CSS not working

PLEASE NOTE A RECENT CHANGE:
The forum is read-only. Please submit any support request here.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts

  • jimgub
    Member
    TT Client
    #5165

    I have created a child theme (skywalker-child); the style.css file in that folder is not overriding the main style.css file. I notice that when I add php files to the child theme directory those are working… also, when I change the import URL int he child style.css file to a bogus entry it has no effect on my site…


    Tesla
    Member
    Member
    #5264

    Hello ,
    please replace the THEME_ROOT/functions.php file with the one attached to this reply . This should fix it .
    Cheers.


    gene158
    Member
    Member
    #5377

    Hi, I’m having the same problem as JIMGUB. I have a child theme setup and all of my CSS styles in the child theme does not override the parent theme’s CSS. I’ve tried replacing the parent’s themes functions.php from the above post but that just made it worse…

    JIMGUB, did the attached functions.php work for you?

    TESLA, this is not working for me… is there an updated theme available?


    gene158
    Member
    Member
    #5378

    OK, finally figured out the problem…

    In my child theme CSS, I was importing the wrong CSS file from the parent theme. I needed to change this to:
    @import url(“../skywalker/css/style.css”);

    In the functions.php that is attached above, I needed to change line 109 to:
    wp_enqueue_style( ‘style’, get_stylesheet_directory_uri() . ‘/style.css’, ”, ”, ‘screen’ );

    Because my child theme stylesheet was not in a CSS folder…

    Hope this helps someone.


    Tesla
    Member
    Member
    #5379

    Thanks @GENE158 !


    jimgub
    Member
    TT Client
    #5677

    sorry for late reply… @GENE158.. yes that worked for me as well! thanks


    codemaestro
    Member
    TT Client
    #21943

    As the last comment was in Nov 2013, I thought I’d update the child theme technique according to the WordPress Codex, which reports that importing the parent theme CSS file is no longer best practice: http://codex.wordpress.org/Child_Themes

    Instead of using an @import uri() declaration in our child theme CSS, modify the child theme functions.php to import the parent and framework stylesheets for Skywalker, inside the <?php ?> block:

    // import style sheets from Skywalker parent theme
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘framework-style’, get_template_directory_uri() . ‘/css/style.css’ );
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’, array( ‘framework-style’) );
    wp_enqueue_style( ‘child-style’, get_stylesheet_uri(), array( ‘parent-style’ ) );
    }

    Hope this helps someone else!


    Tesla
    Member
    Member
    #22431

    Hi there,

    Thank you for this information, we still advice you guys to use our builted in Custom CSS text area for all the additional CSS rules you want to set, it is the easiest and safest way to restyle your project

    Best Regards


    codemaestro
    Member
    TT Client
    #22467

    Hi. That’s not what you said here: https://teslathemes.com/topic/path-one-columns-page-header/ 😉

    So I updated my functions.php to add one more theme CSS file. I’m not sure if I need it, but hey, why not, right?

    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘admin-style’, get_template_directory_uri() . ‘/admin_panel/css/style_admin.css’ );
    wp_enqueue_style( ‘framework-style’, get_template_directory_uri() . ‘/css/style.css’ );
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’, array( ‘framework-style’) );
    wp_enqueue_style( ‘child-style’, get_stylesheet_uri(), array( ‘parent-style’ ) );
    }

    Now we’re having fun.

    -Tony

Viewing 9 posts - 1 through 9 (of 9 total)

Child theme CSS not working

Home Forums WordPress Themes Skywalker Child theme CSS not working

[i]
[i]
[i]
[i]