182 posts
  • Affiliate Level 1
  • Author Level 2
  • Beta Tester
  • Collector Level 2
+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 :)

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+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)

232 posts
  • 5 Years of Membership
  • Author Level 6
  • Affiliate Level 1
  • Collector Level 1
+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');
257 posts
  • Beta Tester
  • Copyright Ninja
  • Featured Author
  • Feedback Guru
+10 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.

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+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.

1368 posts
  • Weekly Top Seller
  • 5 Years of Membership
  • Author Level 6
  • Beta Tester
+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 :)

232 posts
  • 5 Years of Membership
  • Author Level 6
  • Affiliate Level 1
  • Collector Level 1
+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
  • Author Level 12
  • Trendsetter
  • 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) :)

232 posts
  • 5 Years of Membership
  • Author Level 6
  • Affiliate Level 1
  • Collector Level 1
+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 :)

182 posts
  • Affiliate Level 1
  • Author Level 2
  • Beta Tester
  • Collector Level 2
+3 more
n-media
says

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

Espeically sevenspark :)

by
by
by
by
by
by