Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hirejordansmith/9f4dd69fa1287ed57f61 to your computer and use it in GitHub Desktop.
Save hirejordansmith/9f4dd69fa1287ed57f61 to your computer and use it in GitHub Desktop.
How to replace bxSlider controls with Font Awesome icons
jQuery(document).ready(function($) {
$('.bxslider-home').bxSlider({
pagerCustom: '#bx-pager',
mode: 'fade',
onSliderLoad: function(){
$(".bxslider-wrap").css("visibility", "visible");
},
auto: true,
nextText: '<i class="fa fa-angle-right"></i>',
prevText: '<i class="fa fa-angle-left"></i>'
});
});
<?php
// Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css', array(), '4.3.0' );
}
?>
@antongorodezkiy
Copy link

In my case I also had to add text-indent: normal; to make fontawesome icons visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment