How to use animated GIFs in WordPress
If you want to use animated GIFs in WordPress, you may discover the animated GIF has become a static GIF. This happens because of the WordPress resizing mechanism. For each picture you upload, WordPress creates several copies in different sizes. The sizes depend on the theme and plugin settings.
The problem with animated GIFs is, WordPress won’t resize the animated GIF but it will take only the first frame of the file to create the resized versions. So, if you simply add a GIF via the WordPress Media Manager, you will probably grab one of the resized pictures and not the original animation. Make sure, you select the original size. In the image, you can see the select box where you choose the different sizes. If you choose “Full Size”, WordPress will take the original GIF you have uploaded before. Since WordPress hasn’t altered this image, the animation will be still working.
On a more technical level: Depending on which image processing is supported by the server, WordPress will choose GD Image or Imagick. The function _wp_image_editor_choose() in wp-includes/media.php selects, which program is chosen. So, WordPress will resize the picture either with the class WP_Image_Editor_Imagick or with the class WP_Image_Editor_GD, which are both extensions of WP_Image_Editor.