I want to show related posts from category option. In here posts from same category will be displayed. I have solved this isse by putting following code in functions.php in my Basel-Child Theme. But I don’t want to show post excerpt here. If I off post excerpt from theme option, it causes everywhere. Please give me code, I can put here and post excerpt in related post will be off.
function basel_get_related_posts_args( $post_id ) {
$taxs = get_the_category($post->ID);
$args = array();
if ( $taxs ) {
$tax_ids = array();
foreach( $taxs as $individual_tax ) $tax_ids[] = $individual_tax->term_id;
$args = array(
‘category__in’ => $tax_ids,
‘post__not_in’ => array( $post_id ),
‘showposts’ => 4,
‘ignore_sticky_posts’ => 1
);
}
return $args;
}