Viewing 1 replies (of 1 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi!

    Most likely. If the custom field stores the image ID instead of the url, then perhaps this code should help:

    add_filter( "asl_result_image_after_prostproc", "asl_cf_image", 1, 1 );
    
    function asl_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;
    }

    Try putting this code to your themes function.php file.

    Also on the plugin search options page on the image options panel don’t forget to select the custom field containing the image.

Viewing 1 replies (of 1 total)
  • The topic ‘get image form advance custom field’ is closed to new replies.