Forum Moderators: open
Hi,
Does anyone know what code I could add to my sidebar.php to display the posts of the currently logged in user?
Thanks.
<?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!