Multiple related queries by post type/category?
-
Wonderful plugin, many thanks to the author.
We’ve used the Better Related Posts plugin for several years but it is finally so out-dated that we are looking for new options.
The very useful thing about Better Related Posts was that if you didn’t want to use the settings panel, you could make manual calls in the template files. Actually, you could have unlimited queries to display related posts for different post types or categories:
if(function_exists('the_related_get_scores')) { $scores = the_related_get_scores(); // pass the post ID if outside of the loop $posts = array_slice(array_keys($scores), 0, 7); // how many results $args = array( 'post__in' => $posts, 'posts_per_page' => 7, 'category_name' => 'news', 'ignore_sticky_posts' => 1 );
We’ve seen that Contextual Related Posts also has a template option but does it support multiple arrays like above?
<?php if(function_exists('echo_ald_crp')) echo_ald_crp(); ?>
It would definitely be a valuable feature. Cheers!
- The topic ‘Multiple related queries by post type/category?’ is closed to new replies.