List author posts without hardcode
-
Isn’t there a way to list author posts with the loop function like in this hardcode?
<?php $numposts = $wpdb->get_results(" SELECT guid, post_title FROM $wpdb->posts WHERE post_author = " . $curauth->ID . " AND post_type = 'post' AND post_status='publish'"); ?> <ul> <?php foreach ($numposts as $numpost) { echo '<li><a href="'.$numpost->guid.'">'.$numpost->post_title."</a></li>"; } ?> </ul>Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘List author posts without hardcode’ is closed to new replies.