Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My site is basically a Pinterest style product catalogue with atleast one image per post.

I upload large images, thumbnails of which are automatically generated by wordpress BUT the website has been loading really slow because the_content tag by default uses the largest thumbnail image that I choose from the "media" tab while creating the post.

Is there any way to use the smaller thumbnail but link to the larger thumbnail on click?

edited to add: I use the Pinboard theme.

I appended the following in functions.php:

add_theme_support('post-thumbnails');
set_post_thumbnail_size(280, 800);

and this in loop.php:

if ( has_post_thumbnail() ) {
    the_post_thumbnail(); 
} else {
    echo("-");
}

but it shows the else part on the website, so I assume it isn't finding the image used?

Thanks!

share|improve this question
Can you give more info please? Is it a custom theme you use? Have you tried making the default generated thumbnails smaller (to your needs) under settings->media? Have you tried a lightbox plugin? What do you mean by "smaller/larger thumbnail"? The default sizes are: thumb/medium/large. – marikamitsos Jan 6 at 8:24
@marikamitsos Sure, I edited the description – Nimbuz Jan 6 at 8:28
@marikamitsos I upload images from the media tab, then create a post and attach the uploaded image. Although the image shows fine on the homepage but it shows the full version although I can see under uploads that wordpress has generated all sizes. – Nimbuz Jan 6 at 8:30

1 Answer

I think this will help you. It shows how to link to a larger image and display the thumbnail.

Also, if you want to display a smaller image, you can do this

the_post_thumbnail( array(100,100) );

This will generate a thumbnail of size 100px by 100px.

share|improve this answer
Tried this, but returns nothing, its still the same. – Nimbuz Jan 6 at 10:52
can you post some code from loop.php? what exactly does loop.php do? – varun1505 Jan 6 at 15:28
well its a huge file but the only relevant part is the_content cause its the tag that displays the featured image on the homepage, and I need that image to be a "thumbnail" instead of the larger one – Nimbuz Jan 7 at 2:03

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.