WordPress.org

Ready to get started?Download WordPress

Forums

featured image thumbnails (4 posts)

  1. Aron 15
    Member
    Posted 1 year 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?

    Thanks

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

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

    http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src

  3. Aron 15
    Member
    Posted 1 year 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 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.