Thread Starter
a1anm
(@a1anm)
Hi,
I found this piece of code which displays the posts of a specified author:
<?php
$numposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_author = 1");
echo "Posts by Author 1";
<ul>
foreach ($numposts as $numpost) {
echo "
<li>".$numpost->post_title."</li>
";
}
</ul>
?>
All I need to do now is alter this to display the posts of the currently logged in user instead.
Anyone know how to do this?
Cheers!
Thread Starter
a1anm
(@a1anm)
<?php
if ( is_user_logged_in() ) {
echo ' <h2>Author</h2>
<ul>
<li><a>ID; ?>">Author Page</a></li>
</ul>
';
} else {
echo '';
};
?>
Thread Starter
a1anm
(@a1anm)