Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Welcome to you dashboard <?php global $current_user; get_currentuserinfo(); echo ($current_user->user_login); ?>.
  2.  
  3.  
  4.  
  5. <?php
  6. global $current_user;
  7. get_currentuserinfo();
  8. $user = $current_user->ID;
  9.  
  10. $query = new WP_Query( array(
  11. 'author' => $user, // Show Posts made only by the current user.
  12. 'post_type' => 'tutorial',
  13. 'posts_per_page' => '5',
  14. 'post_status' => array(
  15. 'publish',
  16. 'pending',
  17. 'draft',
  18. 'private',
  19. 'trash'
  20. )
  21. ) );
  22. ?>
  23.  
  24. <table>
  25.  
  26. <tr>
  27. <th>Post Title</th>
  28. <th>Post Status</th>
  29. <th>Actions</th>
  30. </tr>
  31.  
  32. <?php
  33. if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
  34.  
  35. <tr>
  36. <td><?php echo get_the_title(); ?></td>
  37. <td><?php echo get_post_status( get_the_ID() ) ?></td>
  38. <td>
  39. <?php the_post_thumbnail(thumbnail); ?>
  40. </a>
  41. </td>
  42. </tr>
  43.  
  44. <?php endwhile; endif; ?>
  45.  
  46. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement