• Resolved Will004

    (@will004)


    I made an export of a previous wordpress blog and imported it in to the new blog (new domain) same server. I used a plugin to retrieve all external images and then had it make local copies. The image links were all updated with the posts. I regenerated thumbnails and even tried to use auto featured image plugin but it doesnt make auto featured images.

    There is roughly 242 posts. They all have an image in the post apart from a handful of video posts.

    In index.php
    Within the following loop;
    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

    I have the following code. If there is no thumbnail or image in the post then it will show a default image.

    The problem is, is that some posts are returning true but no image is being displayed. All video posts displays the default image, but all other posts contain an image. It only displays an image, if I physically edit the post and set a featured image.

    I don’t really want to sift through 200+ posts to do this and no plugins are auto setting featured images. I’ve tried a few.

    <?php if(has_post_thumbnail()) {?>
                    <div class="img-thmb"><?php
    				echo the_post_thumbnail(array(165,130), array('border'=>0,'style'=>'border:1px solid #CCC;')); ?></div>
                    <?php } else {
    				echo '<div class="img-thmb"><img src="http://www.example.com/wp-content/themes/mytheme/images/mytheme_nothumb.png" height="130px;" border="0" width="165px" /></div>';
    				} ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘has_post_thumbnail returns true no image, featured image’ is closed to new replies.