'; if(have_posts()): while ( have_posts() ) : the_post(); $postid = get_the_ID(); $image = wp_get_attachment_image_src(get_post_thumbnail_id($postid), 'large'); $featured_image = $image[0]; if ( !$featured_image): $portfolio_gallery = get_post_meta( $postid, 'mpl_perm_metadata', true ); if( $portfolio_gallery ): $attachment_id_arr = explode(",",$portfolio_gallery); if($attachment_id_arr && is_array($attachment_id_arr)){ $attachment_id = $attachment_id_arr[0]; $image_attributes = wp_get_attachment_image_src( $attachment_id, 'large' ); $featured_image = $image_attributes[0]; } endif; endif; if ( $featured_image !='' ): $html .= '
  • '.esc_attr(get_the_title()).'

  • '; endif; endwhile; endif; $html .= ''; echo $html; the_posts_pagination(); get_footer('mpl');