Last active
June 23, 2022 03:54
-
-
Save giodc/370fa52e41968082bd604eb22e488f12 to your computer and use it in GitHub Desktop.
Check if WordPress featured image is gif, and output full size image to allow animated gif in Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
{the_post_thumbnail('medium', array('class' => 'img-responsive'));} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for snippet but you use ext as constant it should be string: