Hi everybody,
I need help to set two differents thumbnails sizes; A big one for the last article, and then, normal ones.
Here is my custom loop, in order to identify the last post as "featured". Right now, there is just one thumbnail size both for "featured" and "regular".
<?php while (have_posts()) : the_post(); ?>
<?php if (is_paged()) : ?>
<?php $postclass = ('regular'); ?>
<?php else : ?>
<?php $postclass = ($post == $posts[0]) ? 'featured' : 'regular'; ?>
<?php endif; ?>
<div class="<?php echo $postclass; ?>">
<div class="thumbnail">
<!-- post thumbnail -->
<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail(array(583,420)); // Declare pixel size you need inside the array ?>
</a>
<?php endif; ?>
<!-- /post thumbnail -->
</div>
<detail>
<!-- post title -->
<h2>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h2>
<!-- /post title -->
<!-- post details -->
<span class="date"><?php the_time('F j, Y'); ?> <?php the_time('g:i a'); ?></span>
<span class="author"><?php _e( 'Published by', 'html5blank' ); ?> <?php the_author_posts_link(); ?></span>
<span class="comments"><?php if (comments_open( get_the_ID() ) ) comments_popup_link( __( 'Leave your thoughts', 'html5blank' ), __( '1 Comment', 'html5blank' ), __( '% Comments', 'html5blank' )); ?></span>
<!-- /post details -->
<?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?>
<?php edit_post_link(); ?>
</detail>
</div>
<?php comments_template() ?>
<?php endwhile ?>
I tried some stuffs but it doesn't work. I am a beginner in PHP ! :-/
If you could help... Thanks in advance.