Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to display all the posts by the featured image of each post.

Is there a shortcode or can you give me some tips on how to achieve this ?

Thanks!

share|improve this question
    
What are you referring to? Something like a grid theme? –  brasofilo Jun 14 '12 at 20:51
    
yes, something like this, I want to be able to display all my posts as thumbnails and when a user clicks on it to go directly to that specific post –  Cristocea Costel Jun 14 '12 at 21:34

1 Answer 1

you can modify or create a simple posts loop with only feature image in there. so you could use something like :

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    <div class="feature-image">
        <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
    </div>

<?php endwhile; ?>
<?php wp_reset_query(); ?>

then your CSS can be:

.feature-image {
    float:left;
    margin-right:5px;
    }

.feature-image a:link img {
    background: green;
    padding: 3px;
    }

.feature-image a:hover img {
    background:blue;
    }

this should create a simple grid of feature images with a green border that will change to blue when you hover the image. obviously you can change the look of it by adding different styling but this should get you a good start point.

share|improve this answer
    
Thank you! Do you have any ideea how to modify the thumbnail size of the featured image ? –  Cristocea Costel Jun 14 '12 at 23:04
    
That's both a separate question, and one that has been asked many times here on WPSE. Try searching the site for the answer. Hint: add_image_size() is your friend. –  Chip Bennett Jun 14 '12 at 23:08
    
@CristoceaCostel or you can use parameters to change the default: the_post_thumbnail(array(100,80)) where 100 and 80 are width an height in pixels. –  wdalhaj Oct 4 '12 at 16:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.