124 posts
  • Envato Studio (Microlancer) Beta Tester
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • Exclusive Author
  • Referred between 1 and 9 users
  • Bought between 10 and 49 items
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 :)

505 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
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)

168 posts
  • Referred between 1 and 9 users
  • Bought between 1 and 9 items
  • Has been a member for 4-5 years
  • Pakistan
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
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');
17 posts
  • Author had a File in a Mini Bundle
  • Europe
  • Has been a member for 1-2 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
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.

505 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
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.

1078 posts
  • Forum Superstar
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 50 and 99 users
  • Europe
  • Has been a member for 3-4 years
  • Exclusive Author
+1 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 :)

168 posts
  • Referred between 1 and 9 users
  • Bought between 1 and 9 items
  • Has been a member for 4-5 years
  • Pakistan
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
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?

3423 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer 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) :)

168 posts
  • Referred between 1 and 9 users
  • Bought between 1 and 9 items
  • Has been a member for 4-5 years
  • Pakistan
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
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 :)

124 posts
  • Envato Studio (Microlancer) Beta Tester
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • Exclusive Author
  • Referred between 1 and 9 users
  • Bought between 10 and 49 items
n-media says

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

Espeically sevenspark :)

by
by
by
by
by
by