Support » Fixing WordPress » Display and Submit Comments, Outside of WP

  • I’m trying to display comments outside of wordpress, and allow people to post a reply.

    I’ve included “wp-blog-header.php” so I have access to WP functions/data.

    I’m accessing the post by passing the post ID to the page, and calling the “get_post” function.

    $post = $_GET[‘post’];
    $the_post = get_post($post, ARRAY_A);

    And pulling the comments via:
    $comment_array = get_approved_comments($post);

    That all works just fine for displaying the post/comments, but it is not letting me post replies.

    If I try and request the comment form via “comments_template();” I acts like the post is locked for comments, even though it is not. So people can not post a reply.

    What can I do to enable comment posting for this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The message I get when trying to display the “comments_template();” is “Comments are closed.”


    Pretty please?

    Do you have comments enabled in the Settings>Discussion (Default article settings – allow people to post comments)? Do you have “allow comments” set on the post in question? Are you requiring people to register and log in to comment (Settings>General>Membership)?

    Comments are enabled, and when the posts are viewed from within wordpress, commenting works fine.

    We do not require users to register, but they do have to enter a valid email address if they are not registered.

    When I view the external page while logged in, everything looks fine… it recognizes that I am logged in, etc.

    But when I attempt to display the comment form using the normal comments_template() method, I get the “Comments are closed.” message.

    If I manually include the contents of the comments template, and remove the check for comment status, everything looks fine… but when I attempt to post, I am redirected to an old blog post for some odd reason.

    Here is a test page.

    On that page, the comment form is first manually included (by copying the contents of the comments template) Below that, you will see the “Comments are closed.” message, that is generated when I use the comments_template() function.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display and Submit Comments, Outside of WP’ is closed to new replies.