show all the posts thumbnails

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!

Answer

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.

Attribution
Source : Link , Question Author : Cristocea Costel , Answer Author : Eyal

Leave a Comment