181 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
n-media
says

Hi Theme Experts,

I want to include font awesome in my theme, is there an official plugin I can use in the theme? http://fortawesome.github.io/Font-Awesome/icons/

I could not find official and with licensed plugin for this. Please send any suggestions.

Thanks all :)

1073 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
Gareth_Gillman
says

It’s simple to do without a plugin:

1) upload the css and font files to your theme folder

2) Add the CSS to WP head by using the enqueue_style function (link)

225 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
+1 more
MsTrends
says

It’s simple to do without a plugin:

1) upload the css and font files to your theme folder

2) Add the CSS to WP head by using the enqueue_style function (link)

We can actually strip out step one by using CDN link to CSS file. e.g.

wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css');
248 posts
  • Helped protect Envato Market against copyright violations
  • Made it to the Authors' Hall of Fame
  • Contributed a free file of the month
  • Had an item that was trending
+8 more
prestahome
says

I do not know whether the use of a CDN is ok in this case, what if the template you bought a few thousand times and CDN stop working? This is not a large file, it is better to have it locally.

1073 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
Gareth_Gillman
says

I do not know whether the use of a CDN is ok in this case, what if the template you bought a few thousand times and CDN stop working? This is not a large file, it is better to have it locally.

I would also do it locally as the cdn could go down, they could modify it and break the file etc, I prefer to use local copies of scripts just so I am in full control of what happens.

1361 posts
  • Had an item that became a weekly top seller
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
Smartik
says

Include it directly in your theme or plugin and use wp_enqueue_style. Also you may need an array with all names to include in theme options, metaboxes, etc. Here is the help(Please see instructions.): https://github.com/Smartik89/SMK-Font-Awesome-PHP-JSON :)

225 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
+1 more
MsTrends
says

I do not know whether the use of a CDN is ok in this case, what if the template you bought a few thousand times and CDN stop working? This is not a large file, it is better to have it locally.

The answer is same i think, what if google fonts api site goes down? as most of the templates/themes here use those fonts. Although, in this case file size is only 20 KB, its not much, it goes down to ones own choice. However, speaking generally, there are many advantages of using CDN version: Why should I use Google’s CDN for jQuery?

3535 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Had an item that was trending
  • Located in United States
+13 more
sevenspark
Moderator
says

I also vote for placing Font Awesome in your theme/plugin and properly enqueueing it.

Using a CDN for Google Web fonts is one thing – if they don’t load, you have a system fallback.

If Font Awesome icons don’t load, you’ll get a bunch of unknown characters since they’re not in the standard unicode set.

Sidenote: loading jQuery from a CDN is your choice if you’re managing your own site (though then you have to manually keep it up to date), but if you are releasing a theme or plugin publicly you should NEVER do that – it would be very irresponsible (and also isn’t allowed by ThemeForest) :)

225 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
+1 more
MsTrends
says

I also vote for placing Font Awesome in your theme/plugin and properly enqueueing it.

Using a CDN for Google Web fonts is one thing – if they don’t load, you have a system fallback.

If Font Awesome icons don’t load, you’ll get a bunch of unknown characters since they’re not in the standard unicode set.

Sidenote: loading jQuery from a CDN is your choice if you’re managing your own site (though then you have to manually keep it up to date), but if you are releasing a theme or plugin publicly you should NEVER do that – it would be very irresponsible (and also isn’t allowed by ThemeForest) :)

For jQuery in WP, i agree, using CDN version is bad practice as WP has built in jQuery library. But for HTML templates i think CDN version is better (for caching and other benefits). However, if you want to be on safe side you can always include local jQuery version as fallback. Same goes for CSS.

But yes, one can simply use local files for the sake of simplicity :)

181 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
n-media
says

Thank you so much all of you. You guys rocks!! :)

Espeically sevenspark :)

by
by
by
by
by
by