Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $post;
- query_posts ('cat=1 &posts_per_page=10'); ?>
- <?php if ( have_posts() ) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <h4>
- <?php
- the_tags( __( ' ',
- ' ' ), ', ', ''); ?> </p><?php
- $posttags = get_the_tags($post->ID);?>
- </h4>
- <ul>
- <?php
- $tags = wp_get_post_tags($post->ID);
- if ($tags) {
- echo '';
- $first_tag = $tags[0]->term_id;
- $args=array(
- 'tag__in' => array($first_tag),
- 'showposts'=>-0,
- 'caller_get_posts'=>1,
- 'order' => 'ASC'
- );?>
- <?php
- $my_query = new WP_Query($args);
- if( $my_query->have_posts() ) {
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <p style="padding: 1px; margin: 0;">
- <a>">
- <?php the_title(); ?> </a></p>
- <?php endwhile;}}?>
- <!-- /html code -->
- <?php endwhile; ?>
- <?php else : ?>
- <!-- html code if nothing found -->
- <?php endif; ?>
- <?php wp_reset_query();?>
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement