Okay
  Public Ticket #851051
Child Theme CSS
Closed

Comments

  • Kevin started the conversation

    Hi there.

    I really enjoy the Salient theme - well done.  Quick question for you.

    In WordPress, a child theme inherits styles from the parent theme, and the child theme's style.css overrides the parent's style.css.

    When I add custom css to the style.css in my child theme, it does not seem to reflect on my website.  However, when I add the css to the theme options panel, it does work.

    Am I doing something wrong here? I would much rather work in a text editor than the theme options panel.  Is there a way to utilize the child theme's style.css file like how other child themes work?

    Thanks very much.

  • Kevin replied

    After investigating, I noticed there was no call to the child theme style.css.  I added a call for it in the form of:

    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' );

    Styles are taking now.  I am happy with this solution as it is the recommended WordPress way. I would take any comments you have though in case this is incorrect or will conflict with the theme.

    Thanks. Kevin.