Support » Fixing WordPress » all posts have the same comments.. HELP

  • centro

    (@centro)


    hello all, first post here. im having a hell of a time trying to get these comments to work. what happens is, all my comments on different posts show the same comments from a specific post with in id of 6.

    on my single.php ive echo’d out the_ID() from within the loop and get the correct post.

    in my comments template ive echo’d out $post->ID and always get an id == 6. i have no idea why.

    any ideas? im kind of lost as to what to do here, irc has been less than helpful even at peak hours. /sigh

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have this same issue, and cannot locate the source. I was using a comment callback in order to customize the appearance of comments. (listed pings and comment separate) I was sure this was the issue, but when I uploaded the ‘default’ comment.php and reverted my customization, the error still persists.

    My template is 100% from scratch, custom work for a client. I have a feeling this may be caused by a plugin … if I discover anything I will post back here.

    Weird. An echo of $post->ID before the_content() yields expected results, but if I echo $post->ID after the_content(), it gives me the ‘phantom’ ID of a particular post on every page, ID=468. This is the ID that the comments are using, and why all comments posted are posted to this page.

    My first suspect is get_posts and/or query_posts corrupting the loop, but there are no get_posts/query_posts on within this template, or ran at all before the loop.

    Is it possible that there’s some problems with the_content()? Anybody have a solution, or any ideas what may be causing this?

    I was using Custom Widgets Plugin, Disabling this plugin worked for me, but it is likely that it wasn’t the plugin, probably the custom widgets that I did create.

    na3s was right when says something its corrumping the loop, there are two ways to fixit
    the problem occurs when any another query_post from any reason is useit before comments_template()

    if (have_posts()) : while (have_posts()) : the_post();
    $temporal = $post->ID;
    …..
    another query_post from any reason
    …..
    $post->ID = $temporal;
    comments_template();

    so with a temporal fix that issue, the other way its to use a instance for the query $my_query = new WP_Query().

    taiguey

    (@taiguey)

    victoredier: thank you, merci, gracias, choukran, obrigado ouffff spent hours and hours seraching for this: http://www.el-guanabanero.org small village citizen newspaper has now comments working!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘all posts have the same comments.. HELP’ is closed to new replies.