WordPress.org

Ready to get started?Download WordPress

Forums

PinBlue
Child theme stylesheet overridden (4 posts)

  1. kwilson2
    Member
    Posted 1 year ago #

    Hi there,

    Love the theme, can't seem to get it working with a child. I'm at http://www.tucsoncrystalandchinarepair.com/blog

    My best guess is that the parent stylesheet is being loaded after the child, or the child is being ignored completely.

    I've cleared the cache, used !important, and looked through the header and index files for some indication of why it would load the parent last, but to no avail.

    Here's what my childtheme looks like:

    http://pastebin.com/fhqhWEx0

    Any suggestions?

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You don't currently have a child theme active on that site. Did you switch to it (i.e. activate it) once it was set up?

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    Real basic question, but after uploading your child theme, did you activate it? (I've seen several folks forget that part!)

  4. WPThemes.co.nz
    Member
    Posted 1 year ago #

    Hi @kwilson2,

    PinBlue's style is actually loaded using wp_enqueue_style() instead of hardcoding it directly to the theme header.

    So, to load your stylesheet after the parent stylesheet, add the following php code to your functions.php file:

    function pinblue_child_enqueue_style(){
    	wp_enqueue_style('pinblue_child_style', get_stylesheet_directory_uri() . '/style.css', array('pinblue_style'));
    }
    add_action('wp_enqueue_scripts', 'pinblue_child_enqueue_style');

    This will load your child theme's stylesheet after the parent theme's stylesheet.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic