Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

How to create a container where there is a clickable grid of images, where images are the thumbnail of an article?

I need to create in the front-page, a container full of small images, like a photogallery but theese images need to be clickable and must redirect to a page full of details

I thought about a thumbnail of category of article, to show in the container

it need to be done by code, not shortcode, or plugin or something else I already have the page and I need to edit

for reference, I have to make a page like this https://www.kiva.org/

2 Answers

Nattapol Kamolbal
Nattapol Kamolbal
15,528 Points

In the front-page.php where you need to put the images.

Run the loop. Inside the loop, echo the anchor tag with post thumbnail. Something like this:

<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>

Then you need to style your image with css.

thanks :)