Get more posts by tag(s) outside post loop
-
I am creating a few guides, and below my post I want to show recent content based on the tag(s) I file the post under. Does anyone know the script to query to current tag of the post and then show recent content from that tag in an outside the loop query?
I use the following to show 3 recent posts underneath my individual post, but I need to add an additional filter to detect the used tag or tags (depending on how much I file) in that post and then use that as the filter when showing the additional 3 posts.
<?php global $post; $args = array('posts_per_page' => 3, 'post__not_in' => array( $post->ID )); query_posts( $args ); if (have_posts()) : while (have_posts()) : the_post(); ?> [post format here] <?php endwhile; wp_reset_query(); endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get more posts by tag(s) outside post loop’ is closed to new replies.