I beleive in media settings there’s an option to crop or show proportional thumbnails. So you’ll want to show them proportional.
Not sure what you mean by “default thumbnail on featured page”
Do you mean:
All posts in category A have thumbnail A
All posts in category B have thumnbail B
ect.
?
Yes, there is an option at the media settings which let you set the thumbnail size.
And you mean to use a default thumbnail when you haven’t set a specific thumbnail? yes.
There is a plugin for that or you can do it by code:
<?php $thumb = get_the_post_thumbnail();
if ( ! empty( $thumb ) ):
echo get_the_post_thumbnail($page->ID, array(130,181));
else : ?>
<img src="your default thumb here">
<?php endif;?>
Change the 130 and 181 to the size you want
wonder if a category filter could be applied? Perhaps something like this, but I haven’t tested, I’m not a good coder.
<?php $thumb = get_the_post_thumbnail();
if ( ! empty( $thumb ) ):
echo get_the_post_thumbnail($page->ID, array(130,181));
else :
if (is_category('category-1')) { ?>
<img src="your default thumb here">
<?php } ?>
<?php if (is_category('category-2')) { ?>
<img src="your default thumb here">
<?php } ?>
<?php endif;?>
Thread Starter
naijay
(@naijay)
@dbalden when I set the thumbnail size, the photo still appears as one big blurr on the main page. As if it was zoomed in too far. I’m not sure what’s happening with that… the dimensions are currently set to 150×150.
I’m wondering if the code for my featured posts on the main page is teh reason why this is happening?
Once I get this issue resolved, I’ll take a look at the code you provided to set the default thumbnail.
Thanks so much!
@deepbevel thanks for your input. The settings option didn’t seem to help to change the issues i was having!
I see the thumbnails are still cropped. If you set them to be proportional under settings, it may be the case that the images need to be re-uploaded for the change to take. You might try it with one to test.
coinicidently, I’m having a similar issue, one of my thumbs is proportional but the others are cropped, the images are the same size and have the same media library settings. I’ve tried re uploading the image and turning off the plugins but the issue persists. I’ll try another theme next.
Thread Starter
naijay
(@naijay)
@deepbevel ok, well I hope we can both get our issue sorted! It just looks really weird! Not a very pleasant look to have! lol
where the code says
get_the_post_thumbnail();
try using one of these
get_the_post_thumbnail($id, 'thumbnail'); // Thumbnail
get_the_post_thumbnail($id, 'medium'); // Medium resolution
get_the_post_thumbnail($id, 'large'); // Large resolution
get_the_post_thumbnail($id, array(100,100) ); // Other resolutions
It solved my issue, now all thumbnails use the same defaults