Font Awesome Filed not properly Work in custom post type
-
public function styles_and_scripts() {
// only load the styles for eligable post types
if ( in_array( get_current_screen()->post_type, $this->screens ) ) {
// load up font awesome
wp_enqueue_style( ‘fa-field-fontawesome-css’, FA_URL . ‘css/font-awesome/css/font-awesome.min.css’ );
// load up plugin css
wp_enqueue_style( ‘fa-field-css’, FA_URL . ‘css/fa-field.css’ );
// load up plugin js
wp_enqueue_script( ‘fa-field-js’, FA_URL . ‘js/fa-field.js’, array( ‘jquery’ ) );
}
}in this function comment the if condition like this
public function styles_and_scripts() {
// only load the styles for eligable post types
// if ( in_array( get_current_screen()->post_type, $this->screens ) ) {
// load up font awesome
wp_enqueue_style( ‘fa-field-fontawesome-css’, FA_URL . ‘css/font-awesome/css/font-awesome.min.css’ );
// load up plugin css
wp_enqueue_style( ‘fa-field-css’, FA_URL . ‘css/fa-field.css’ );
// load up plugin js
wp_enqueue_script( ‘fa-field-js’, FA_URL . ‘js/fa-field.js’, array( ‘jquery’ ) );
// }
}, then it will work fine in custom post type
- The topic ‘Font Awesome Filed not properly Work in custom post type’ is closed to new replies.