WordPress.org

Ready to get started?Download WordPress

Forums

icon-edit for custom post type breaks media uploader (3 posts)

  1. housebg
    Member
    Posted 2 years ago #

    I've created a custom post type, and was adding in a 32x32 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?

  2. arleena
    Member
    Posted 2 years ago #

    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 }

  3. housebg
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic