Skip to content

Instantly share code, notes, and snippets.

@giodc
giodc / wordpress-check-if-image-is-gif
Last active June 23, 2022 03:54
Check if WordPress featured image is gif, and output full size image to allow animated gif in Loop
<?php
$url = wp_get_attachment_url( get_post_thumbnail_id() );
$filetype = wp_check_filetype($url);
if ($filetype[ext] == 'gif')
{the_post_thumbnail('full', array('class' => 'img-responsive')); }
else