media file not loading in (keeps spinning indefinitely)
-
Hi! Please help me.
- I inactivated all working plugins, but the problem is remain. Maybe the problem is that there was in the theme functions.php in this (not original) script, I deleted it:
function add_img_size($content){ ? $pattern = '/<img [^>]*?src="(https?:\/\/[^"]+?)"[^>]*?>/iu'; ? preg_match_all($pattern, $content, $imgs); ? foreach ( $imgs[0] as $i => $img ) { ??? if ( false !== strpos( $img, 'width=' ) && false !== strpos( $img, 'height=' ) ) { ????? continue; ??? } ??? $img_url = $imgs[1][$i]; ??? $img_size = @getimagesize( $img_url ); ??? if ( false === $img_size ) { ????? continue; ??? } ??? $replaced_img = str_replace( '<img ', '<img ' . $img_size[3] . ' ', $imgs[0][$i] ); ??? $content = str_replace( $img, $replaced_img, $content ); ? } ? return $content; } add_filter('the_content','add_img_size');
- How is it possible to add fix value for the images (height, width), to create better CLS value (cache problem), if I use only the editor of theme.
Thank you!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘media file not loading in (keeps spinning indefinitely)’ is closed to new replies.