Home » Php » php – gif support in featured image. How do this?

php – gif support in featured image. How do this?

Posted by: admin February 25, 2020 Leave a comment

Questions:

I would like to write a code in php. Which gif in ‘featured image’ supports.
Well, when I enter the site, the gif is to be inactive. I hover over it with the mouse. The gif starts up.

Code for what I found:

<img id = "myImg" src = "staticImg.png" />

<Script>
     $ (function () {
         $ ( "# MyImg"). Hover (
             function () {
                 $ (this) .attr ("src", "animatedImg.gif");
             }
             function () {
                 $ (this) .attr ("src", "staticImg.jpg");
             }
         );
     });
</ Script>

I don’t know how to convert it to be universal. You have to put it in the functions.php file

together with add_theme_support ('post-thumbnails');

If I understand correctly. How to convert the code? To support all gifs on my blog.

Thanks for your help!

How to&Answers: