- Navigate to your WordPress dashboard.
- Go to "Plugins" and click on "Add New."
- Search for and install the "Custom Post Type UI" plugin.
- Activate the plugin.
- In the dashboard, find "CPT UI" and click on "Add/Edit Post Types."
- Add a new custom post type by filling in the required details.
- Save the custom post type.
- Go to "Appearance" and click on "Menu."
- Add the custom post type to the menu.
- Save the menu.
- Go to your theme editor and open the functions.php file.
- Add the following code to enqueue Dashicons for your custom post type:
function enqueue_custom_post_type_dashicons() {
wp_enqueue_style('dashicons');
}
add_action('admin_enqueue_scripts', 'enqueue_custom_post_type_dashicons');
- Save the changes.
- Verify that Dashicons are now available for your custom post type in the WordPress dashboard.