Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //display posts authored by the logged in user
- if ( is_user_logged_in() ) {
- global $current_user;
- get_currentuserinfo();
- $args=array(
- 'author' => $current_user->ID,
- 'post_type' => 'post',
- 'post_status' => 'publish, private'
- );
- global $post;
- query_posts ('cat=1 &posts_per_page=1'); ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <?php
- //for use in the loop, list post titles related to first tag on current post
- $tags = wp_get_post_tags($post->ID);
- if ($tags) {
- echo '';
- $first_tag = $tags[0]->term_id;
- $args=array(
- 'tag__in' => array($first_tag),
- 'showposts'=>-1,
- 'caller_get_posts'=>1
- );
- $my_query = new WP_Query();
- if( $my_query->have_posts() )
- {
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <ul>
- <a href="<?php the_permalink(); ?>">
- <?php the_title();?></a>
- </ul>
- <?php endwhile;}}}?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement