Automattic / musictheme

A theme for bands and musicians that uses an experimental Gutenberg layout.
GNU General Public License v2.0
88 stars 11 forks source link

Stylesheets not working for child theme #51

Closed JessBoctor closed 5 years ago

JessBoctor commented 5 years ago

Hi there!

Love this WIP theme! I am working on creating a site with it when I ran into some problems setting up a child theme.

I had enqueued both the parent and child styles as described in the codex here: https://codex.wordpress.org/Child_Themes

However, when I would refresh the site, no styles would be applied except for the font changes I had already made in the child theme. When I went back to the musictheme/functions.php file, I found that line 175 read as follows:

wp_enqueue_style( 'musictheme-base-style', get_stylesheet_uri() );

This means that the theme is enqueuing the child theme stylesheet rather than the music theme stylesheet. A quick change to

wp_enqueue_style( 'musictheme-base-style', get_template_directory_uri() . '/style.css' );

and the issue was resolved. I just thought I would let you know and put this out there for anyone else who may run into this issue.

Thanks again!

JessBoctor commented 5 years ago

After reading through this ticket ([https://wordpress.org/support/topic/enqueing-child-theme-stylesheets/]), I realized the use of get_stylesheet_uri() was intentional.

I went back, reviewed my enqueuing and got it to work properly after changing line 175 back to the original format. All set. Closing the ticket.