Support » Plugin: Custom Post Type UI » Adding icon to the post type

Viewing 7 replies - 1 through 7 (of 7 total)
  • I agree. This functionality is needed.
    To have something like: ‘menu_icon’ => plugins_url(‘/img/my_icon.png’, __FILE__) as part of the $args array.

    yes…. please please please….

    I just added this to my functions.php file:

    // Add new Custom Post Type icons
    add_action( 'admin_head', 'cpt_icons' );
    function cpt_icons() {
    ?>  <!--escape the regular php dillimeter to allow for regular html below-->
     <style type="text/css" media="screen">
      #menu-posts-cptnamegoeshere .wp-menu-image {
       background: url(<?php bloginfo('url') ?>/wp-content/themes/cpt-icons/iconsmall.png) no-repeat 6px !important;
    		.icon32-posts-cptnamegoeshere {
    			background: url(<?php bloginfo('url') ?>/wp-content/themes/cpt-icons/iconlarge.png) no-repeat !important;
    <?php }

    Then create 2 different png files in the /wp-content/themes/cpt-icons/
    folder and name them: iconsmall.png and iconlarge.png.
    the small icon should be 16×16 pixels and the large one 36×36 pixels.

    Please remember to change the css classnames to your custom posttype.
    So if you have a cpt called “projects” cahnge it to:

    this doesn’t work.
    “unexpected token rparen found”.

    How fix it ?

    thanks very much.

    Plugin Author Michael Beckwith


    frafra85, not sure where that is coming from. I don’t believe that “rparen” is part of the plugin code.

    Plugin Author Michael Beckwith


    Regarding the menu icon support, noted that down and will get it in the roadmap.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding icon to the post type’ is closed to new replies.