.borderless-related-post {background-color:'. $related_post_background_color .'; }
.borderless-related-post:hover {background-color:'. $related_post_background_color_hover .'; }
.borderless-related-post:hover .borderless-related-post-body-title {color:'. $related_post_title_hover .'; }
.borderless-related-post:hover .borderless-related-post-body-content {color:'. $related_post_content_hover .'; }
';
$content .= '
';
$content .= '
'.$related_posts_heading.'
';
function get_excerpt(){
$options = get_option('borderless');
$related_posts_excerpt_value = isset( $options['related_posts_excerpt_value'] ) ?: '60';
$excerpt = get_the_content();
$excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
$excerpt = strip_shortcodes($excerpt);
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, $related_posts_excerpt_value);
return $excerpt;
}
$related = get_posts(
array(
'category__in' => wp_get_post_categories(get_the_ID()),
'numberposts' => $related_posts_value,
'post__not_in' => array(get_the_ID())
)
);
if( $related )
$content .= '
';
foreach( $related as $post ) {
setup_postdata($post);
if ($related_posts_image == true && has_post_thumbnail()) {
$img = get_the_post_thumbnail( get_the_ID(), $related_posts_image_resolution, array( 'class' => 'borderless-related-post-body-image' ) );
} else {
$img = '';
}
$content .= '
';
}
$content .= '
';
wp_reset_postdata();
return $content;
} else {
return $content;
}
}
add_filter( "the_content", "related_posts_after_post_content" );
?>