• 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

Calling Dashicons

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 › Calling Dashicons

This topic is: resolved

Tagged: dashicons

  • This topic has 4 replies, 3 voices, and was last updated 9 years, 4 months ago by Victor Font.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 14, 2016 at 9:25 am #176488
    Len
    Participant

    I am curious about something. What is the preferred method for incorporating Dashicons in a child theme?

    Method #1

    wp_enqueue_style( 'prefix-dashicons-style', get_stylesheet_directory_uri(), array('dashicons'), '1.0' );

    Method #2

    wp_enqueue_style( 'dashicons' );

    I ask because when using the former, the child theme style.css file ends up being called twice while the latter results in the css file bundled with WordPress (in the wp-includes folder) to be called.

    I suspect Method #2 is the preferred?

    January 14, 2016 at 9:31 am #176489
    Ozzy
    Member

    Method #2 would be the preferred choice, imo.


    Ozzy Rodriguez | Twitter | Google+

    January 14, 2016 at 9:46 am #176491
    Len
    Participant

    That's what I'm thinking. I'm still refining my skills and want to do things the right way. 🙂

    January 14, 2016 at 9:53 am #176493
    Ozzy
    Member

    Aren't we all?? 🙂


    Ozzy Rodriguez | Twitter | Google+

    January 14, 2016 at 9:53 am #176494
    Victor Font
    Moderator

    Dashicons are loaded automatically by WordPress. There's no reason to reload them in a child theme. Also, in the first method, you don't have the path to the css file. The array is a dependency that means don't load this file until dashicons is loaded. The fact that you are using a function to the stylesheet directory is telling the code to load style.css.


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

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