WordPress.org

Support

Support » Themes and Templates » icon-edit for custom post type breaks media uploader

icon-edit for custom post type breaks media uploader

  • I’ve created a custom post type, and was adding in a 32×32 custom icon using this code

    add_action( 'admin_head', 'lbz_customservice_icons' );
    
    function lbz_customservice_icons() {
        ?>
        <style type="text/css" media="screen">
        #icon-edit.icon32-posts-service {background: url(<?php bloginfo('stylesheet_directory') ?>/images/groupgear32.png) no-repeat;}
    <?php }

    It adds the icon perfectly, BUT as soon as I do that it breaks the media uploader and just displays a blank white box instead of the uploader. If I remove the icon, it all works perfectly again.

    Any idea where this is conflicting?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey housebg,

    Your php code is fine. You just forgot to close your css tag.
    I was successfully able to integrate your code in my blog just by closing the style tag and it does not break the upload box. Example,

    add_action( ‘admin_head’, ‘my_post_icons’ );

    function my_post_icons() {
    ?>
    <style type=”text/css” media=”screen”>
    .icon32.icon-post, #icon-edit, #icon-post {
    background: url(‘your/image/path/here’) no-repeat;
    }
    </style>
    <?php }

    DOH! Thank you. It’s amazing how you can miss the simplest things, isn’t it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘icon-edit for custom post type breaks media uploader’ is closed to new replies.
Skip to toolbar