website logo
  • Documentation
  • Home
  • »
  • Doc
  • FRONT END
  • »
  • SNIPPETS – WORDPRESS
  • »
  • Dashicons

SNIPPETS - WORDPRESS

  • SECURITY
    • Custom excerpt for password protected pages
    • Hide WordPress version for security reasons
  • WOOCOMMERCE
    • Add only one product to cart
    • Change related products section title
    • Change the number of product thumbnails columns per post in product galleries
    • Order by title, date or price on catalog page
    • Redirect add to cart to checkout page
    • Update cart when modifying the item quantity
    • Update total price when quantity updates
  • ADMIN
    • Disable update notification emails.
    • Disable wp-cron
    • Remove notifications from all admin pages except dashboard
    • SVG Support
    • DUPLICATE BUTTON
  • MAINTENANCE
    • Delete orphaned post meta data
    • Delete the orphaned product variations that exist on your WooCommerce site
    • Find the number of orphaned variations that exist on your site
    • Maintenance mode
  • FRONT END
    • Dashicons
  • TRACKING
    • Add Facebook conversion event to WooCommerce order thank you page
    • Facebook Pixel
    • Google Tag Manager Code
  1. Home
  2. Docs
  3. SNIPPETS – WORDPRESS
  4. FRONT END
  5. Dashicons

Dashicons

Adding Dashicons in WordPress Front-end

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

Remove dashicons in frontend to non-admin

add_action( 'wp_enqueue_scripts', 'abstract_dequeue_dashicon' );
function abstract_dequeue_dashicon() {
    if (current_user_can( 'update_core' )) {
        return;
    }
    wp_deregister_style('dashicons');
}

Updated on September 29, 2022
website logo

Επιλογές

  • Documentation
created by ACTUS anima