WordPress.org

Ready to get started?Download WordPress

Forums

Cannot post comments (8 posts)

  1. pearlanddotty
    Member
    Posted 7 years ago #

    When I attempt to post comments on my site, I get the following message:

    Error: This file cannot be used on its own.

    Any idea why this is happening? My sister, who is another user, is still able to comment as usual.

  2. JNeal
    Member
    Posted 7 years ago #

    I am having the exact problem.

  3. catryan
    Member
    Posted 7 years ago #

    I have just upgraded from 1.5.3 to 2.0.2. Everything else works except the comments. All my old comments remain, but no one can post new comments. When I click on the comment button, it just opens the same site page again.

  4. pearlanddotty
    Member
    Posted 7 years ago #

    There must be some sort of filter at my work, because I can post comments from my home computer just fine.

  5. syntax
    Member
    Posted 7 years ago #

    there are a small handful of people i know who get the exact same error.

  6. tobrien1
    Member
    Posted 7 years ago #

    Hi Catryan,

    I went up to 2.0.3 last week and like you am getting the same behaviour - noone can post a comment.

    Haven't found a solution/explanation yet but will keep on plugging away!

  7. tobrien1
    Member
    Posted 7 years ago #

    As per above, I've just stepped through the code and found the problem symptom in comments.php:
    Line 70 comments.php
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    You must be /wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in to post a comment.
    <?php else : ?>

    As you can see above, the variable user_ID is the culprit (although I also took the redirect to the permalink in the login url below this code - it never allowed you to login and just threw you back to the permalink).

    Even when someone goes and logs in, when they navigate back to a particular post, the user_ID variable is not set and as a result they could never post.

    As a stop gap solution, I have edited out this code to allow for user comments.

    All the best,
    Tom

  8. WPChina
    Member
    Posted 7 years ago #

    Would this be classified as a bug, then? Maybe something that can be changed in the future?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags