WordPress.org

Ready to get started?Download WordPress

Forums

zAlive
[resolved] How to access CSS in this theme? (7 posts)

  1. boxcandy
    Member
    Posted 11 months ago #

    Hi, I made a child theme and activated it, but when I make changes to styles.css nothing happens. Am i missing something?

  2. zenoven
    Member
    Theme Author

    Posted 11 months ago #

    Hi @boxcandy,

    so what have you done to change the style.css ?

  3. boxcandy
    Member
    Posted 11 months ago #

    I can delete every line of the child theme style sheet and it has NO effect. There must be something wrong with the link the style sheet

  4. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    the theme seems to enqueue the parent theme's style.css regardless whether you use a child theme;

    you could add a functions.php to your child theme with the necessary code to enqueue your child theme's style.css;

    example of new functions.php:

    <?php
     function zAliveChild_scriptsAndStyles() {
        wp_enqueue_style( 'zAliveChild-style', get_stylesheet_directory_uri() . '/style.css', array( 'bootstrap','bootstrap-responsive' ) );
    	}
    
    add_action( 'wp_enqueue_scripts', 'zAliveChild_scriptsAndStyles', 20 );
    
    ?>
  5. zenoven
    Member
    Theme Author

    Posted 11 months ago #

    Hi all,

    I'm checking this issue now and it seems to be a bug while loading the style sheet file.

  6. zenoven
    Member
    Theme Author

    Posted 11 months ago #

    bug located,

    in version 1.1.10 , functions.php on line 439

    function zAlive_scriptsAndStyles(){
    ...
    wp_enqueue_style( 'zAlive-style', get_template_directory_uri() . '/style.css', array( 'bootstrap','bootstrap-responsive' ) );
    ...
    }

    the second parameter get_template_directory_uri() . '/style.css' does not work for child theme,I replaced it with get_stylesheet_uri() and it works fine now.

    Thanks @boxcandy and @alchymyth !

  7. boxcandy
    Member
    Posted 11 months ago #

    Thanks for the replies guys, Zenoven I replaced the code as you suggested and it seems to be working fine now, thanks. Nice theme by the way!

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.