<div class="clr"></div>
<div class="pad5"></div>
<h3 class="dotted"><?php _e('Other items listed by','cp'); ?> <?php echo $curauth->display_name; ?></h3>
<div class="pad5"></div>
<ul>
<?php
// lets get all the other ad listings by this author
$sql = $wpdb->prepare("SELECT * FROM $wpdb->posts "
. "WHERE post_author = $curauth->ID "
. "AND post_type = 'post' "
. "AND post_status = 'publish' "
. "ORDER BY ID DESC");
$authorposts = $wpdb->get_results($sql);
?>
<?php if ($authorposts): ?>
<?php foreach ($authorposts as $post): ?>
<li>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</li>
<?php endforeach; ?>
<?php else: ?>
<p><?php _e('No ads by this poster yet.','cp'); ?></p>
<?php endif; ?>
</ul>
There are currently 1 users browsing this thread. (0 members and 1 guests)