Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global $post;
- $current_post = $post->ID;
- $posttags = get_the_tags();
- if ($posttags) {
- foreach($posttags as $tag) {
- $tag = $tag->slug; break;
- }
- $args = array(
- 'post__not_in' => array( $current_post ),
- 'tag' => $tag,
- 'posts_per_page' => -1);
- query_posts( $args );
- while (have_posts()) : the_post(); ?>
- <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
- <?php endwhile;
- wp_reset_query();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement