Skip to content

Instantly share code, notes, and snippets.

@anwerashif
Last active February 23, 2018 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anwerashif/18aa13a838df47e4c984eb77b7be8a8a to your computer and use it in GitHub Desktop.
Save anwerashif/18aa13a838df47e4c984eb77b7be8a8a to your computer and use it in GitHub Desktop.
Add FontAwesome Icon to Search Form Input Button
<?php
// Do NOT add the PHP opening tag
// Add Icon Fonts to theme
add_action( 'wp_enqueue_scripts', 'rs_enqueue_styles' );
function rs_enqueue_styles() {
wp_enqueue_style( 'fa', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), '4.5' );
}
// Add search icon to Genesis search form input button
add_filter( 'genesis_search_button_text', 'rs_search_button_text' );
function rs_search_button_text( $text ) {
return esc_attr( '&#xf002;' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment