Advertisement
deepbevel

Untitled

Jan 31st, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 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. $args=array(
  8. 'author' => $current_user->ID,
  9. 'post_type' => 'post',
  10. 'post_status' => 'publish, private'
  11. );
  12.  
  13. ?>
  14.  
  15.  
  16. <?php global $post;
  17. query_posts ('cat=1 &posts_per_page=1'); ?>
  18.  
  19.  
  20.  
  21. <div class="post" id="post-<?php the_ID(); ?>">
  22.  
  23.  
  24.  
  25. <?php
  26. //for use in the loop, list post titles related to first tag on current post
  27. $tags = wp_get_post_tags($post->ID);
  28. if ($tags) {
  29. echo '';
  30. $first_tag = $tags[0]->term_id;
  31. $args=array(
  32. 'tag__in' => array($first_tag),
  33. 'showposts'=>-1,
  34. 'caller_get_posts'=>1
  35.  
  36.  
  37. );
  38. $my_query = new WP_Query();
  39.  
  40. if( $my_query->have_posts() )
  41. {
  42. while ($my_query->have_posts()) : $my_query->the_post(); ?>
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. <ul>
  50.  
  51. <a href="<?php the_permalink(); ?>">
  52.  
  53. <?php the_title();?></a>
  54.  
  55.  
  56. </ul>
  57.  
  58. <?php endwhile;}}}?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement