Support » Fixing WordPress » First Image when Setting Featured Image is a Filename Not Thumbnail

  • I have added a custom post type to a a WordPress theme and it worked fine initially but now something has happened and whenever I try to set a featured image on my new custom post type the first image in the set featured image list is a blank thumbnail with a class type of class=”filename” instead of class=”thumbnail”.

    Due to this I can not set featured images for this post type. All others are fine.

    Here are the first two thumbnail HTML snippets, first is the wrong one and the second is correct:

    <li class="attachment details selected save-ready">
    		<div class="attachment-preview type- subtype- landscape">
    				<img src="" class="icon" draggable="false">
    				<div class="filename">
    					<div></div>
    				</div>
    				<a class="check" href="#" title="Deselect"><div class="media-modal-icon"></div></a>
    		</div>
    	</li>
    
    	<li class="attachment save-ready">
    		<div class="attachment-preview type-image subtype-jpeg portrait">
    				<div class="thumbnail">
    					<div class="centered">
    						<img src="http://XXXXXX/wp-content/uploads/2013/04/aami-logo.jpg" draggable="false">
    					</div>
    				</div>
    				<a class="check" href="#" title="Deselect"><div class="media-modal-icon"></div></a>
    		</div>
    	</li>

    It is rendered in wp-includes/media-template.php and the data.type is empty for the first item. I tried not rendering all data.type’s that were empty but it still partially renders….

    Either way this is the only difference i can find between a featured image being set correctly and one that doesnt

    Any help would be great

    Thanks

  • The topic ‘First Image when Setting Featured Image is a Filename Not Thumbnail’ is closed to new replies.