Welcome to WebmasterWorld Guest from 50.16.68.229

Forum Moderators: ergophobe

WP Display Posts From User

   
2:14 am on Jun 19, 2009 (gmt 0)

5+ Year Member



Hi,

Does anyone know what code I could add to my sidebar.php to display the posts of the currently logged in user?

Thanks.

6:08 pm on Jun 22, 2009 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Would this help?
[codex.wordpress.org...]
6:23 pm on Jun 22, 2009 (gmt 0)

5+ Year Member



Figured it out:

<?php if (is_user_logged_in() ) {
foreach ($numposts as $numpost) {
if($numpost->post_author == wp_get_current_user()->ID) {
echo "<ul><li><a href='".get_page_link($numpost->ID)."'>".$numpost->post_title."</a></li></ul>";
}
}
}
else {
echo '';
}
?>

Thanks!

6:46 pm on Jun 22, 2009 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Good job and thanks for posting the code!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month