Reply To: Error image

#3416
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

This sounds like the image field does not actually contains the image url, but something else. The MIME type error indicates that the browser interpeted it as text, which usually means, that the image url is incorrect.

Moreover the url “http://www.afsdp.org.pe/leguia-la-historia-oculta/610/” is definitely not an image url, it just points to one of your pages.

After diggin up some old tickets I found a similar issue solved for someone. The ACF actually does not store the image url, but the image ID. Thus you need some post-processing function in order to make it work.
This is what solved the issue for him. Put the following code into your themes functions.php file:


add_filter( "asp_result_image_after_prostproc", "asp_cf_image", 1, 1 );
  
function asp_cf_image( $image ) {
  if ($image != "" && strlen($image) < 10) {
    $atts = wp_get_attachment_image_src( $image );
    if (isset($atts[0]))
      return $atts[0];
    return null;
  }
  return $image;
}
Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)