Trying to get font awesome to work properly in wordpress, i am currently using the bones theme with the visual composer plugin.
if i make a wysiwyg html box and copy some info in there with the class for font awesome it shows the icon however when published to the site it shows nothing. link below is the backend with icon appearing in preview but not text.
backend page content
Frontend not displaying it either
front end not displaying
I have enqueued it like this:
// Font Awesome Icons
function font_awesome() {
// CDN Network For Font Awesome Icons
wp_register_style('font_awesome','http://netdna.bootstrapcdn.com/fontawesome/4.0.3/css/font-awesome.css');
wp_enqueue_style('font_awesome');
add_action('wp_print_styles', 'font_awesome');
}
have i missed something or is this a bug? any ideas? thanks.
I just saw that your
add_action
call is inside yourfont_awesome
function. So your function will never be called, and the font awesome script will never be enqueued.Moreover, you shouldn’t use
wp_print_styles
as it is deprecated since WP 3.3 and can provoke an incompatibility that make the scripts enqueue in admin. Usewp_enqueue_scripts
instead: