Support » Plugin: Kirki Customizer Framework » Why Load Two Of The Same Style Sheets When Kirki Is Not Active

  • Resolved ThemeAWESOME


    I have a quick question, my theme TotalPress is being reviewed right now and I had to do some correcting of issues.

    I deactivated Kirki and then I looked at the page source and I noticed it loads the themes style sheet:

    <link rel='stylesheet' id='totalpress-css' href='http://localhost/forge/wp-content/themes/totalpress/style.css?ver=1.0.14' type='text/css' media='all' />

    and then it loads this style sheet right under it:

    <link rel='stylesheet' id='totalpress_no-kirki-css' href='http://localhost/forge/wp-content/themes/totalpress/style.css' type='text/css' media='all' />

    and then right after it loads this:

    <style id='totalpress_no-kirki-inline-css' type='text/css'>
    .grid-container,.inside-top-sidebar,.inside-header,.top-bar,.inside-footer-widgets,.inside-footer{max-width:1200px;}body{color:#3f3f3f;font-family:Source Sans Pro;font-weight:400;font-size:17px;line-height:1.5;letter-spacing:0;text-transform:none;}a{color:#b02329;}a:hover,a:focus{color:#3f3f3f;}.site-branding{text-align:left;}.header-sidebar{text-align:right;}.inside-top-sidebar{text-align:right;}

    Curious as to why it loads two of the same stylesheet? I am using the fallback PHP Class class-my-theme-kirki.php file.

    Shouldn’t it just load the _no-kirki-inline-css along with the themes main stylesheet?

    • This topic was modified 3 years, 1 month ago by ThemeAWESOME.
    • This topic was modified 3 years, 1 month ago by ThemeAWESOME.
Viewing 1 replies (of 1 total)
  • Plugin Author Ari Stathopoulos


    The fallback class is just an idea of how to get things working and ideally developers would tweak it to suit their own themes.
    The way it’s designed right now is a safe way to do things. But it’s by no means optimal!! It’s only meant as a starting point that will get you started.

    If you look at the file you should see something like this in there:

    // Enqueue the theme's style.css file.
    $current_theme = ( wp_get_theme() );
    wp_enqueue_style( $current_theme->stylesheet . '_no-kirki', get_stylesheet_uri(), null, null );
    wp_add_inline_style( $current_theme->stylesheet . '_no-kirki', $styles );

    Change it this:

    // Enqueue the extra styles.
    wp_add_inline_style( 'THEME_STYLESHEEL_HANDLE', $styles );

    replacing THEME_STYLESHEEL_HANDLE with the actual handle you’re using for your theme’s stylesheet. 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Why Load Two Of The Same Style Sheets When Kirki Is Not Active’ is closed to new replies.