1

My Thumbnails seem squished for some reason even though I copied the code from some thumbnails I have that seem to be working fine.

The code that works:

in index.php

<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'category-thumb',array('title' => "")); ?>
</a>

in functions.php

//Main Thumbnail Size
if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'category-thumb', 192, 134 );
}

The thumbs above work fine, resizing the main image to 192x134 without a problem.

The code below does not work.

in sidebar.php

<li>
    <a class="sidebar-thumb" href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'sidebar-thumb',array('title' => "")); ?></a>       
    <a class="sidebar-link" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>      
</li>

in functions.php

//Sidebar Thumbnail Size
if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'sidebar-thumb', 47, 47 );
}

What did I do incorrectly?

1

Had to regenerate all thumbnails. The name of the plugin is "regenerate thumbnails" for those that may run into a similar issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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