How to Enable The WordPress Dashicons on the Frontend

Use the Power of WordPress Dashicons on the Frontend

In the dynamic world of web development, aesthetics and user experience play a pivotal role. WordPress, being a leading content management system, offers a plethora of tools to enhance the visual appeal of websites. One such tool is Dashicons – a set of icons that seamlessly integrate into the WordPress dashboard.


WordPress Dashicons on the Frontend Introduction

While Dashicons are typically readily available in the backend, enabling them on the frontend requires a bit of configuration. In this article, we’ll explore how to unlock the potential of WordPress Dashicons on the frontend using a simple code snippet.


// Add Action for WordPress Dashicons to work on the WordPress Theme frontend
// Start Activation for the Function to Enable Dashicons  in WordPress Frontend

add_action( 'wp_enqueue_scripts', 'seo_book_pro_enable_wp_dashicons_on_the_front_end' );
function seo_book_pro_enable_wp_dashicons_on_the_front_end() {
wp_enqueue_style( 'dashicons' );
}

// End the Activation Function to Enable Dashicons in WordPress Frontend

 


Go to the Official WordPress Dashicons Page to See all Icons and Learn more how to work with them for your WordPress Custom Templates and Website Projects


Let’s break down the code to understand its functionality


add_action( 'wp_enqueue_scripts', 'seo_book_pro_enable_wp_dashicons_on_the_front_end' );

 

This line initiates an action hook, specifying that the function seo_book_pro_enable_wp_dashicons_on_the_front_end should be executed during the WordPress enqueue scripts process.
Enqueueing scripts is a standard practice in WordPress to load stylesheets and scripts efficiently.


function seo_book_pro_enable_wp_dashicons_on_the_front_end():

 

This function is where the magic happens. It utilizes the wp_enqueue_style function to enqueue the ‘dashicons’ style.
By enqueuing the ‘dashicons’ style, we instruct WordPress to load the necessary CSS file containing the Dashicons styles.


wp_enqueue_style( 'dashicons' );

This line specifically enqueues the ‘dashicons’ style, ensuring that the required CSS is loaded on the frontend.


Conclusion

By incorporating this code snippet into your WordPress theme, you can effortlessly enable Dashicons on the frontend, enhancing the visual appeal of your website. Whether you’re a seasoned developer or a WordPress enthusiast, leveraging Dashicons can contribute to a more polished and professional user interface. Embrace the power of Dashicons and take your website’s design to the next level!

SEO Book Pro Demo Beta v.0.53.98 WordPress v.6.6.1

Widget Locations Footer Widget 1

Location Office Name and Data 1
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 2
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 3
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 4
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 5
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper

Widget Locations Footer Widget 2

Location Office Name and Data 6
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 7
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 8
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 9
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 10
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper

Widget Locations Footer Widget 3

Location Office Name and Data 11
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 12
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 13
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 14
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper
Location Office Name and Data 15
  • Maecenas lobortis dui in eleifend ultrices
  • Vestibulum convallis arcu ac semper dapibus
  • Maecenas aliquet turpis nec erat tristique, sit amet pulvinar sem placerat
  • Nam ut tortor volutpat, dapibus tortor eu, auctor nunc
  • Sed efficitur quam in tristique molestie
  • Maecenas sit amet metus quis magna dignissim semper

Main Office Widget

Main Service Name in City, State/Country

[Brand Name]


4.6 star star star star star_half 487 Google reviews
fact_checkService options Online appointments
placeAddress Street Number and Name, City, State Post Code
Opening Hours
  • Tuesday Open 24 hours
  • Wednesday Open 24 hours
  • Thursday Open 24 hours
  • Friday Open 24 hours
  • Saturday Open 24 hours
  • Sunday Open 24 hours
  • Monday Open 24 hours

Health & safety Measures taken here Appointment required Service options Online appointments
© 2021 Company, Inc
Brand Name
Social 5/6 Links (more)
Disclaimer

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Terms & Conditions

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Privacy Policy

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.