I guess, setup_postdata()
http://codex.wordpress.org/Function_Reference/setup_postdata is not meant to be applied to comments;
http://codex.wordpress.org/Function_Reference/get_comments
what are you trying to putput anyway?
your code is broken; you possibly copied from some broken source; this line does not make any sense:
<li class="cat-item"><a>"><?php the_title(); ?></a>
the link htl tag is broken; the closing li tag is missing; it says cat-item while you are dealing with comments …..
thanks for reply. The closing tag of <li>
maybe is lost in copy&past procedure 😛
so i’ve solved my problem using $comment->comment_content instead of setup_postdata() !!!!!!!
(@sn0z33r)
11 years, 5 months ago
Hi all,
i’m playing with my first wp template and i would to have a latest 5 generic comments about all of my posts. Looking the functions reference page i’ve found a function that seems to solve my problem, get_comments() but it doesn’t work fine or.. how i think that it should works !
i’m using this code:
but i receive this message:
Notice: Undefined property: stdClass::$ID in /home/public_www/0code.it/www/wp-includes/query.php on line 3592
for more times, and 5 times the same comment, so the comments by id = 1 “Hello world!”.
How can i solve my problem ?? is there anyone that have some ideas or hints to give me ??
thanks 😉