Check if WordPress featured image is gif, and output full size image to allow animated gif in Loop

You already know that animated gif in WordPress are also resized to media sizes, so, if your theme do not use “full”¬†featured image size in template, the animated gif will not display correctly.

you can use this code in WordPress loop, to check if the image is a gif, and output in full size that retain the animations frame of the image. Be careful on sizes of .gif files, because it output in full resolution can be slow-down your site.