Hey,
I have seen one of the methods of creating related posts through your plugin WP show posts. Use this plugin and activate the Element module.
Add this code in the hook in order to show the related posts by Category:
<h2>Related Posts</h2>
<?php
if ( is_single() ) {
$cats = get_the_category();
$cat = $cats[0];
} else {
$cat = get_category( get_query_var( ‘cat’ ) );
}
$cat_slug = $cat->slug;
$list = get_page_by_title( ‘related’, ‘OBJECT’, ‘wp_show_posts’ );
wpsp_display( $list->ID, ‘tax_term=”‘ . $cat_slug . ‘”‘ );
?>
——-
I found this in this blog: https://www.wplogout.com/display-related-posts-in-generatepress-theme/
Could you please check this code and let me know so that I can add it on my website without installing any other related post plugin except yours WP show posts.