I want to know how I can show some list of related post when some one clicks one post.
for example when some one clicks on informatica post , it should show some particular list of post in right bar,
Informatica transformation
[lookup Transformation]
[Router transformation]
[Rank Transformation]
[Normalizer Transformation]
Informatica Admin
similarly if someone click post on oracle , then it should show oracle related post ( some main post which i want to show , not by plugin itself,
If you are using a custom theme or child theme, you could add code like this to the page in question. It determines all the categories for the current post, and then finds the other posts in those categories.
<?php
$post = get_post();
if ( $post ) {
// Get all the categories for the current post
$categories = get_the_category( $post->ID );
foreach ($categories as $category) {
// Add a loop to get all posts for each of these categories
$args = array(
'cat' => $category
);
$my_query = new WP_Query( $args );
// Display the titles of all posts with that category
if ( $my_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
}
echo '</ul>';
} else {
// no posts found
}
wp_reset_postdata();
}
}