How to use PHP code to display related post with thumbnails
-
First up, thanks for this amazing plugin. This is the most lite plugin I had found for displaying related posts using taxonomies.
By far, I’ve been using this code to display related posts from taxonomies using this code
<?php // check if the function already exists if ( function_exists( 'km_rpbt_related_posts_by_taxonomy' ) ) { $args = array( 'posts_per_page' => 10, ); $taxonomies = array('movie'); $related_posts = km_rpbt_related_posts_by_taxonomy( $post->ID, $taxonomies, $args ); if( $related_posts ) { echo '<ul>'; // loop through related posts foreach ( (array) $related_posts as $related ) { // title is the post ID if a post doesn't have a title $title = ($related->post_title) ? $related->post_title : $related->ID; echo '<li><a href="' . get_permalink( $related->ID ) . '">' . $title . '</a></li>'; } echo '</ul>'; } } ?>
But, since I’ve updated to the new version which also supports to display post thumbnails. Can you please tell me how to alter this code to display related posts from a taxonomy, in a single column?
Thanks!
https://www.ads-software.com/plugins/related-posts-by-taxonomy/
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘How to use PHP code to display related post with thumbnails’ is closed to new replies.