Código PHP:
<?
if(get_query_var('author_name')) :
$curauth = get_userdatabylogin(get_query_var('author_name'));
else :
$curauth = get_userdata(get_query_var('author'));
endif;
$querystr = "
SELECT comment_ID, comment_post_ID, post_title, comment_content
FROM $wpdb->comments, $wpdb->posts
WHERE user_id = $curauth->ID
AND comment_post_id = ID
AND comment_approved = 1
ORDER BY comment_ID DESC
";
$comments_array = $wpdb->get_results($querystr, OBJECT);
if ($comments_array): ?>
<h2>Recent Comments </h2>
<ul>
<?foreach ($comments_array as $comment):
setup_postdata($comment);
echo "<li><a href='". get_bloginfo('url') ."/?p=".$comment->comment_post_ID."'>Comment on ". $comment->post_title. "</a><br />". $comment->comment_content . "</li>";
endforeach;?>
</ul>
<? endif; ?>
Código:
No encuentro cuál puede ser el error... comments, $wpdb->posts WHERE user_id = $curauth->ID AND comment_post_id = ID AND comment_approved = 1 ORDER BY comment_ID DESC "; $comments_array = $wpdb->get_results($querystr, OBJECT); if ($comments_array): ?> Recent Comments Comment on ". $comment->post_title. " ". $comment->comment_content . ""; endforeach;?>