• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Two Style Sheets Being Called

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Two Style Sheets Being Called

This topic is: not resolved

Tagged: css, enqueue scripts, wp_enqueue_scripts

  • This topic has 4 replies, 4 voices, and was last updated 4 years, 2 months ago by SueCrawford.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 16, 2016 at 5:11 am #185696
    leighm
    Member

    Hi,

    I'm having a problem with my style sheet being called twice. I'm using the enterprise pro theme, and in the head of my template it's calling two versions of the same style sheet.

    ver 2.1.1 and ver 4.5.2

    They also have a different id for each one:

    enterprise-pro-theme-css
    enterprise-css

    <link rel="stylesheet" id="enterprise-pro-theme-css" href="http://localhost/smcu/wp-content/themes/enterprise-pro/style.css?ver=2.1.1" type="text/css" media="all">
    <link rel="stylesheet" id="enterprise-css" href="http://localhost/smcu/wp-content/themes/enterprise-pro/style.css?ver=4.5.2" type="text/css" media="all">

    Any idea of how and where from it's calling the second instance of the style sheet? I notice that it doesn't appear to be enqueued from the functions.php like it would be in a non genesis theme.

    Here's the Enqueue Scripts.

    
    //* Enqueue Scripts
    add_action( 'wp_enqueue_scripts', 'enterprise_load_scripts' );
    function enterprise_load_scripts() {
    
    	wp_enqueue_script( 'enterprise-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'enterprise-js', get_bloginfo( 'stylesheet_directory' ) . '/js/scripts.js', array( 'jquery' ), '1.0.0' );
    
    	wp_enqueue_style( 'dashicons' );
    
    	wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Raleway:400,300,700,300italic', array(), CHILD_THEME_VERSION );
    
    }
    

    Thanks.

    May 16, 2016 at 6:07 am #185697
    Victor Font
    Moderator

    Child theme style sheets are enqueued in the Genesis Framework, not in functions.php. The function that loads the child sheet is in /lib/css/load_style.php. If a child theme is active, it loads the child theme's style sheet, otherwise, it loads the Genesis style sheet. That particular function can only load 1 style sheet. It's not possible for it to load two. The 2.1.1 version is the correct version for Enterprise Pro.

    I suspect that the old style sheet is hard coded somewhere and not being enqueued. Look in the Genesis Header Scripts or if you are using Genesis Simple Hooks, look there.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 16, 2016 at 6:32 am #185698
    leighm
    Member

    Hi Victor,

    Thanks for your reply. It's helped me isolate the source of the problem. I added functionality to allow my client to enter their own featured background image on the homepage. They can do this by going to Appearances > Customize.

    To do this I had to create two files in the lib folder, one of them being output.php. There's a function in that file that included this line:

    
    wp_enqueue_style( 'enterprise', get_stylesheet_directory_uri() . '/style.css' );
    
    

    I removed this line and it removed the reference to the 2nd instance of the style.css file.

    Thanks.

    May 19, 2016 at 1:13 am #185881
    phamtuanh
    Member

    Thanks


    nấm lim xanh very good nam lim xanh ok

    March 21, 2018 at 8:57 pm #218227
    SueCrawford
    Participant

    I think I am having the same problem with two stylesheet versions. They are named:
    ...themes/enterprise-pro/style.css?ver=1.0
    ...themes/enterprise-pro/style.css?ver=2.1.1

    This was identified through a scan done by GTmetrix. We are trying to figure out why the site is so slow and we keep having random problems.

    I'm afraid I'm not savvy enough to understand the thread where this was discussed earlier. Could someone explain simply how I remedy this?

    Thanks for any help...

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble