Webmaster Sun Login
Not a member yet? Sign up

Wordpress - How to get a gif working as a Featured Image? Big Problem?!

  • HOME
  • FORUMS
  • WHAT'S NEW
  • BLOGS
  • MARKETPLACE
  • ADVERTISING
  • SPECIAL OFFERS
  • WEB HOSTING
  • QUICK MENU
  • REGISTER HERE - Join us for FREE
Results 1 to 6 of 6
    Stick this thread
  1. #1
    Join Date
    Aug 2017
    Posts
    28
    Thumbs Up/Down
    Received: 2/0
    Given: 1/0
    Thanks
    2
    Thanked 1 Time in 1 Post

    Wordpress - How to get a gif working as a Featured Image? Big Problem?!

    Since some time I am trying to get a gif working as a featured image on wordpress. I know it can be done but all modification I made till now did not work! They are working inside the post but not on the frontpage… any ideas?
    Last edited by DanielBlue; 11-16-2017 at 06:24 PM.

  2. #2
    Join Date
    May 2016
    Posts
    713
    Thumbs Up/Down
    Received: 76/1
    Given: 807/2
    Thanks
    49
    Thanked 54 Times in 53 Posts
    You can add this code to functions.php in your theme folder

    Code:
    <?php $thumb_url = get_the_post_thumbnail_url();
    	  $thumb_low = strtolower($thumb_url);
    	  if (strpos($thumb_low, '.gif') === false) {
    	  	$thumb_size = 'large';
    	  } else {
    	  	$thumb_size = 'full';
    	  } ?>
    Normally, Wordpress will process your featured images via this function the_post_thumbnail() and it will resize your image to 150x150 thus your gif image will not work. Now when you added that function then it will always display your image size as uploaded.

    Hope that helped.

  3. #3
    Join Date
    Aug 2017
    Posts
    28
    Thumbs Up/Down
    Received: 2/0
    Given: 1/0
    Thanks
    2
    Thanked 1 Time in 1 Post
    Thank you but when adding the code the page is not working anymore at all.
    Last edited by DanielBlue; 11-16-2017 at 06:24 PM.

  4. #4
    Join Date
    May 2016
    Posts
    713
    Thumbs Up/Down
    Received: 76/1
    Given: 807/2
    Thanks
    49
    Thanked 54 Times in 53 Posts
    Quote Originally Posted by DanielBlue View Post
    Thank you but when adding the code the page is not working anymore at all.
    Make sure that you only add

    Code:
    $thumb_url = get_the_post_thumbnail_url();
    	  $thumb_low = strtolower($thumb_url);
    	  if (strpos($thumb_low, '.gif') === false) {
    	  	$thumb_size = 'large';
    	  } else {
    	  	$thumb_size = 'full';
    	  }
    Remove open/close PHP tag in codes above.

    Code:
    <?php
    
    ?>

  5. #5
    Join Date
    Aug 2017
    Posts
    28
    Thumbs Up/Down
    Received: 2/0
    Given: 1/0
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Marc van Leeuwen View Post
    Make sure that you only add

    Code:
    $thumb_url = get_the_post_thumbnail_url();
    	  $thumb_low = strtolower($thumb_url);
    	  if (strpos($thumb_low, '.gif') === false) {
    	  	$thumb_size = 'large';
    	  } else {
    	  	$thumb_size = 'full';
    	  }
    Remove open/close PHP tag in codes above.

    Code:
    <?php
    
    ?>
    No, not working. I am using a premium theme, looks like it's not made for doing so.
    Last edited by DanielBlue; 11-16-2017 at 06:25 PM.

  6. #6
    Join Date
    May 2016
    Posts
    713
    Thumbs Up/Down
    Received: 76/1
    Given: 807/2
    Thanks
    49
    Thanked 54 Times in 53 Posts
    Quote Originally Posted by DanielBlue View Post
    No, not working. I am using a premium theme, looks like it's not made for doing so.
    It is not more differences between Wordpress default themes, free and premium themes out there.

    You might need someone look into codes in your theme to fix this issue.

  7. The Following User Says Thank You to Marc van Leeuwen For This Useful Post:
    DanielBlue (11-13-2017)

Newer Threads

  1. samie peralta
    OctaBaz
    Replies: 18 | Views: 1555
    Last post by OctaBaz, 12-06-2018, 05:58 PM
  2. hakireview
    About Backlinks from DMCA?
    By hakireview in forum Google
    SEOPub
    Replies: 8 | Views: 1712
    Last post by SEOPub, 07-09-2018, 03:40 AM
  3. aretteprieve
    aretteprieve
    Replies: 6 | Views: 1407
    Last post by aretteprieve, 12-04-2017, 09:01 AM
  4. Dopani
    Dopani
    Replies: 0 | Views: 345
    Last post by Dopani, 11-14-2017, 11:07 AM
  5. Dopani
    Dopani
    Replies: 0 | Views: 363
    Last post by Dopani, 11-14-2017, 11:11 AM

Older Threads

  1. Jim15
    Jim15
    Replies: 0 | Views: 775
    Last post by Jim15, 11-11-2017, 03:12 PM
  2. macfais
    Mike001
    Replies: 2 | Views: 950
    Last post by Mike001, 11-12-2017, 11:44 AM
  3. mafel
    ulterios
    Replies: 2 | Views: 919
    Last post by ulterios, 11-11-2017, 08:28 PM
  4. Dopani
    Dictator20
    Replies: 5 | Views: 1074
    Last post by Dictator20, 11-18-2017, 03:42 PM
  5. Dopani
    Rob Whisonant
    Replies: 1 | Views: 965
    Last post by Rob Whisonant, 11-11-2017, 05:17 PM

Latest Threads

  1. stephenrobes
    Disavow tool
    By stephenrobes in forum Search Engine Optimization
    ralphmiller
    Replies: 3 | Views: 31
    Last post by ralphmiller, Today, 05:57 AM
  2. susanburling
    susanburling
    Replies: 0 | Views: 56
    Last post by susanburling, 03-22-2019, 02:10 PM
  3. msulcs
    msulcs
    Replies: 3 | Views: 256
    Last post by msulcs, 03-16-2019, 06:37 PM
  4. susanburling
    davidlee21
    Replies: 2 | Views: 134
    Last post by davidlee21, 03-15-2019, 07:19 PM

Similar Threads

  1. RenderedElite
    RenderedElite
    Replies: 0 | Views: 1020
    Last post by RenderedElite, 10-27-2017, 11:30 PM
  2. Dopani
    RobertMore
    Replies: 1 | Views: 3402
    Last post by RobertMore, 09-06-2014, 03:05 PM
  3. Maxwell
    Maxwell
    Replies: 0 | Views: 1667
    Last post by Maxwell, 07-29-2014, 10:34 AM
  4. Harris
    Harris
    Replies: 0 | Views: 1320
    Last post by Harris, 05-11-2013, 06:26 AM
  5. nick
    HostNurse
    Replies: 4 | Views: 2725
    Last post by HostNurse, 09-10-2012, 12:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Internet Marketing Forum

Webmaster Sun is a forum where you’ll find in-depth discussions and resources to help you succeed on the web whether you are new or experienced. You’ll find it all here. With topics ranging from internet marketing, search engine optimization, social networking, make money online, web hosting, affiliate marketing as well as hands-on technical support for web design, programming and more. We are a growing community of like-minded people that is keen to help and support each other with ambitions and online endeavors. Learn and grow, make friends and contacts for life.

Come Hang Out With Us

    Facebook Twitter Webmaster Forum Google+

    Webmaster Sun Logo
Copyright ©2012 - 2019, WebmasterSun.com. All rights reserved. Internet marketing forum for internet marketers, webmasters, web hosting providers, designers and affiliate marketers.

Welcome to Webmaster Sun

The World's Number 1 Webmaster Community, SEO and Marketplace

Log in!

Continue with Facebook
Continue With Email. By signing up you indicate that you have read and agree to the Terms of Service and Privacy Policy.

Sign in Manually

Need an account? Sign up now!