3

I have a problem with a featured image. It's a gif, but when I add it, Wordpress adds the dimensions to the filename, which breaks the gif (since then it's not really a gif anymore).

Is there a way to disable the addition of dimensions to the filename for only the featured image?

The link to my image is: http://whatweblog.com/wp-content/uploads/2015/05/hue.gif The link to my image after selecting it as a featured image is: http://whatweblog.com/wp-content/uploads/2015/05/hue-620x349.gif

I guess Wordpress is making a thumbnail of my image, but I don't want and need that, since I want the gif to be moving and on the front page.

I remember having no problem at all with this in the past, but now Wordpress adds the dimensions, breaking the GIF in the process.

1 Answer 1

2

In addition to creating additional dimension, Wordpress does keep your original image. Your original image is in this link http://whatweblog.com/wp-content/uploads/2015/05/hue.gif

So, instead of stopping Wordpress from creating additional dimension, you should retrieve the full image when displaying the featured image. You can get the full image with this -

the_post_thumbnail('full');

In your case, change

<?php the_post_thumbnail('featured-image', array('class' => 'featured-full-width-top')); ?>

to

<?php the_post_thumbnail('full', array('class' => 'featured-full-width-top')); ?>

Remove Thumbnail Generation

See https://wordpress.stackexchange.com/a/91170/23214

Another easier option I think works is going to your Settings-->Media and setting each box for width and height to 0

3
  • I found out by using the EXACT dimensions (350 instead of 349 high) the GIF works fine. But still want to prevent this from happening. Do I have to replace <?php the_post_thumbnail('featured-image', array('class' => 'featured-full-width-top')); ?> with <?php the_post_thumbnail('featured-image', array('class' => 'full')); ?>?
    – Rvervuurt
    Commented May 31, 2015 at 16:04
  • @Rvervuurt See my edit
    – sakibmoon
    Commented May 31, 2015 at 16:14
  • I don't really know what kind of result the media-setting has on other stuff, so I just changed the php-part. Thanks!
    – Rvervuurt
    Commented May 31, 2015 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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