'. $aio_related_posts_settings['list_title'] .'
';
foreach($searches as $search) {
$categorys = get_the_category($search->ID); //Fetch categories of the plugin
$p_in_c = false; // Variable to check if post exists in a particular category
$title = get_the_title($search->ID);
$title = aio_title_shorter($title,10);
//---------------------------------
echo '- ';
if($aio_related_posts_settings['list_show_images'] == 'Yes'){
$out_post_thumbnail = '
';
if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail($search->ID))) {
$out_post_thumbnail .= get_the_post_thumbnail( $search->ID, array($aio_related_posts_settings[list_imagew],$aio_related_posts_settings[list_imageh]), array('title' => $title,'alt' => $title,'class' => 'listimage','border' => '0'));
} else {
$postimage = get_post_meta($search->ID, $aio_related_posts_settings[list_custom_image], true);
$dont_show_image = 'No';
if (!$postimage)
{
preg_match_all( $reg_exp, get_post($search->ID)->post_content, $matches );
// any image there?
if( isset( $matches ) && $matches[1][0] ) {
$postimage = $matches[1][0]; // this give the first image only
preg_match_all( $new_reg_exp, get_post($search->ID)->post_content, $matches2 );
$new_img_src = $matches2[1][0];
//echo $new_img_src;
//will resize the image here
}}
$site_url = site_url();
$postimage = str_replace("../",$site_url."/",$postimage);
$out_post_thumbnail .= '
';
if (!$postimage) {$dont_show_image = 'Yes';}
}//of line 27
//$out_post_thumbnail .= ''. get_the_time('M j, Y',$search->ID) .'';
$out_post_thumbnail .= ' ';
if ($dont_show_image == 'Yes') $out_post_thumbnail = '';
}else{//for line 19 if
$out_post_thumbnail = '';
}
echo $out_post_thumbnail;
echo '';
echo ''; echo $title; echo '
';
echo aio_excerpt($search->ID,$aio_related_posts_settings['list_excerpt_length']);
echo "";
echo " ";
if ($search_counter == $limit) break; // End loop when related posts limit is reached
} //end of foreach loop
$credits_link = 'by my ip
';
if($aio_related_posts_settings[print_credits_link] != 'yes' || is_user_logged_in()) $credits_link = '';
if ($ver_type == 'paid') $credits_link = '';
echo '
' .$credits_link. '';
}//end of searches if statement
else{
echo 'No related posts
';
}
?>