Advertisement
deepbevel

Untitled

Jan 31st, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. //display posts authored by the logged in user
  3. if ( is_user_logged_in() ) {
  4. global $current_user;
  5. get_currentuserinfo();
  6. ?>
  7.  
  8.  
  9. <?php global $post;
  10. query_posts ('cat=1 &posts_per_page=1'); ?>
  11. <div class="post" id="post-<?php the_ID(); ?>">
  12.  
  13.  
  14. <?php
  15. //for use in the loop, list post titles related to first tag on current post
  16. $tags = wp_get_post_tags($post->ID);
  17. if ($tags) {
  18. echo '';
  19. $first_tag = $tags[0]->term_id;
  20. $args=array(
  21.  
  22. 'tag__in' => array($first_tag),
  23. 'showposts'=>-1,
  24. 'caller_get_posts'=>1,
  25. 'order' => 'DESC'
  26. );
  27.  
  28. $my_query = new WP_Query($args);
  29.  
  30. if( $my_query->have_posts() )
  31. {
  32. while ($my_query->have_posts()) : $my_query->the_post(); ?>
  33.  
  34. <ul>
  35.  
  36. <a href="<?php the_permalink(); ?>">
  37.  
  38. <?php the_title();?></a>
  39.  
  40. </ul>
  41.  
  42. <?php endwhile;
  43.  
  44. } } }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement