featured image thumbnails (4 posts)

  1. Aron 15
    Posted 3 years ago #

    Hi everyone,

    I'm trying to use this code to display the featured images of each post within a category...

    <?php while (have_posts()) : the_post(); ?>    
    		<?php if (has_post_thumbnail( $post->ID ) ): ?>
        		<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    		<li><img onload="fadeIn(this)" class="image" src="<?php echo $image[0]; ?>"></li>
    		<?php endif; ?>
                   <?php endwhile; ?>

    Is it possible for this code to show the 'large' version of the image - I have tried everything but can't seem to be able to get it to work..

    Maybe I am missing something?


  2. Michael
    Forum Moderator
    Posted 3 years ago #

    have you tried to replace 'single-post-thumbnail' with 'large' ?


  3. Aron 15
    Posted 3 years ago #

    Thank you! I tried this initially but it didn't work - it appears that the files I were looking at didn't have any different sized 'thumbnails' uploaded... Is there a way I can batch resize these files or will they need uploading again? Thanks

  4. esmi
    Forum Moderator
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.