Home / admin / Change the custom post type icon for admin menu
  • How to Change the custom post type icon for admin menu

    change-the-custom-post-type-icon-for-admin-menu

    Adding this snippet to the functions.php of your wordpress theme will create a custom post type products. On line 10 of this snippet we have menu_icon change the URL to the location of your 16px by 16px icon to display in the admin menu.

    ( click code to copy )

    wordpress snippet : PHP - create custom post type

    <>
    $args = array(
            'label' => __('Products'),
            'singular_label' => __('Product'),
            'public' => true,
            'show_ui' => true,
            'capability_type' => 'page',
            'hierarchical' => false,
            'rewrite' => true,
            'query_var' => 'products',
    	'menu_icon' => 'http://site.com/wp-content/themes/theme_name/i/icon_16x16.png',
            'supports' => array('title','editor','comments','thumbnail')
    );
    register_post_type( 'product' , $args );
    

    ( WordPress codex functions, hooks, in this snippet. )

    register, query, register_post_type, __, _n, wp,
  • diljan

    hi kevin

    this snips brake my site in wp3.5.1.