Set a font icon like font awesome or genericons as a custom menu_icon in wordpress

I’m now adding a custom post type in wordpress.

function custom_post_type() {

    $labels = array(
        'name'                => 'Custom Type',
        'singular_name'       => 'Custom Type',
        'menu_name'           => 'Custom Type',
        // ....
    );
    $args = array(
        // ...
        // The below matters!
        'menu_icon' => get_template_directory_uri().'/images/my-icon.png',
    );
    register_post_type( 'custom_type', $args );
}
add_action( 'init', 'custom_post_type', 0 );

My trouble is:

I want to set the menu_icon as a font-icon, like font-awesome or genericons.

Read More

How can I do with it?

Related posts

Leave a Reply

1 comment