1. Home
  2. ReHub Theme
  3. Advanced tips and customizations
  4. How to show animated Gif on site

How to show animated Gif on site

If you want to use animated gif on site, you will find that there is one problem. All images on category pages, homepage and archives will be static. It’s because wordpress use first frame when resizes images. Here code, which will prevent resize for gif images

add_filter('rh_thumb_resized_url', 'custom_full_size_resized');
function custom_full_size_resized($url){
  if (strpos($url, '.gif') !== false) {
    $url = get_post_thumb();
  }
  return $url;
}

Add this to functions.php of child theme or grandchild plugin. How to customize theme

Was this article helpful to you? Yes 1 No 2

How can we help?