cat_ID;
if ( $category_iddd != 203 ) { // Hide post 203 cat id
if(is_single()) {
// Show/Hide Reated Post
$srp_main_title_enable = get_option('srp_main_title_enable','1');
$srp_post_title_enable = get_option('srp_post_title_enable','1');
$srp_main_title_text = get_option('srp_main_title_text','Related Post');
$srp_post_number = get_option('srp_post_number','5');
$srp_post_orderby = get_option('srp_post_orderby','date');
$srp_post_order = get_option('srp_post_order','DESC');
$srp_category_post = get_the_terms(get_the_ID(),'category');
$srp_category_post_in = array();
foreach ($srp_category_post as $term) {
$srp_category_post_in[] = $term->term_id;
}
$srp_related_post = new WP_Query(array(
'post_type' => 'post',
'category__in' => $srp_category_post_in[1],
'post__not_in' => array(get_the_ID()),
'posts_per_page' => $srp_post_number,
'orderby' => $srp_post_orderby,
'order' => $srp_post_order
));
$srp_post = $srp_related_post->have_posts();
// Show Category
$categories = get_the_category();
if($srp_main_title_enable == '1'){
if(!$srp_post == '') {
$default .= "
$srp_main_title_text
";
}
}
$column = 1;
$featured_list = array();
$default .= "";
while($srp_related_post->have_posts()):$srp_related_post->the_post();
// Veriable Declear
$srp_post_link = get_the_permalink();
ob_start();
//$default .= '
';
// Show Content
if($srp_post_title_enable == '1'){
$spr_post_t_r = array( 'Wipers','wipers','Wiper','wiper','Blade','blade','Size','size','Windshield','windshield' );
$srp_post_t_r2 = str_replace( $spr_post_t_r, '', get_the_title() );
$col_class = 'post-col-' .$column;
if(!$isfeatured) {
$default .= "";
} else {
$featured_list[] = "";
}
// Increase the Column count
$column++;
// After count has displayed 3, we reset the count
if($column == 4){
$column = 1;
// Print everything in the array, doing nothing if empty
foreach ($featured_list as $featured_item) {
echo $featured_item;
}
// Reset the array
$featured_list = array();
}
} // End if
$default .= ob_get_clean();
//$default .= "
";
// End Content
endwhile;
$default .= "
";
// Style Include from srp_style.php
srp_style();
wp_reset_postdata();
return $default;
}else { // Single Post
return $default;
}
}else{ // Hide cat
return $default;
}
}
}
new srp_reg();