X

Change the custom post type icon for admin menu

Redirection Review - Options

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.



Code Snippet:


$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 );

Comments  Leave a Reply

  1. hi kevin

    this snips brake my site in wp3.5.1.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!