• 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

Add style.css Dependency

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 › Add style.css Dependency

This topic is: not resolved

Tagged: dependency, style

  • This topic has 3 replies, 3 voices, and was last updated 12 years, 4 months ago by Victor Font.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 8, 2014 at 2:48 pm #93963
    jgardner
    Member

    I would like to add a dependency to my child theme's style.css file (in this case it's dashicons) so I don't have to worry about enqueue'ing the stylesheet myself or making sure it's loaded before my theme's sheet. Is there a documented way of doing this that doesn't involve removing the genesis_enqueue_main_stylesheet() action and inserting my own? In the load-styles.php file I don't see any filter (which is honestly surprising given that seemingly everything else is filterable), so my guess is no, but I figured I'd check anyway. If there isn't, could I offer it up adding a filter as a suggestion for a future version?

    Thanks guys and gals!

    March 9, 2014 at 10:55 pm #94121
    essaysnark
    Participant

    You might want to direct this to Studiopress support instead

    http://my.studiopress.com/help/

    March 13, 2014 at 11:55 am #94711
    Victor Font
    Moderator

    I'm using Executive Pro. This is what I did. Look in your theme's functions.php file and find the following line:

    
    wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700', array(), CHILD_THEME_VERSION );

    and change it to:

    
    wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700', array('dashicons'), CHILD_THEME_VERSION );

    It works for me.


    Regards,

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

    March 14, 2014 at 8:02 am #94856
    Victor Font
    Moderator

    An alternative is to load the dashicons in the same function that loads the google fonts but before the google fonts are loaded. As in this example from my Executive Pro theme:

    //* Enqueue Google fonts
    add_action( 'wp_enqueue_scripts', 'executive_google_fonts' );
    function executive_google_fonts() {
    	wp_enqueue_style( 'dashicons' );
    	wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700', array(), CHILD_THEME_VERSION );
    
    }

    If you visit my site, the magnifying glass icon in the search is a dashicon symbol. Hover over it and it changes color.

    http://victorfont.com/


    Regards,

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

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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

© 2026 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