Support » Themes and Templates » Base Knowledge Theme Base Child CSS

  • Resolved double_dd



    There is a child theme already bundled with this theme but it doesn’t seem to be allowing the style.css in the child to override the parent style.css.

    I have 2 theories:

    1) The link to the stylesheet isn’t working properly in the head – not sure if it’s meant to pull the child theme but it doesn’t. the code is:
    wp_enqueue_style( 'main-style', get_template_directory_uri(). '/style.css', false, '1.4', 'all');

    which then generates:

    <link rel='stylesheet' id='main-style-css' href='' type='text/css' media='all' />

    2) You can hard code the style in the head and this does over ride styles. Now this is loaded after so should work as it does.

    Is there something theme specific making this hard work? I’ve got child themes working on other sites and there is no difference between the child stylesheets I have.

    All other files in the child theme work as expected e.g. header.php etc

Viewing 1 replies (of 1 total)
  • Now resolved:

    Instead of this:

    wp_enqueue_style( 'main-style', get_template_directory_uri(). '/style.css', false, '1.4', 'all');

    use this:

    wp_enqueue_style( 'main-style', get_stylesheet_directory_uri(). '/style.css', false, '1.4', 'all');

    This then picks up the child theme instead of using the parent theme in the link to the stylesheet.

Viewing 1 replies (of 1 total)
  • The topic ‘Base Knowledge Theme Base Child CSS’ is closed to new replies.