WordPress.org

Ready to get started?Download WordPress

Forums

Display and Submit Comments, Outside of WP (6 posts)

  1. Exavior
    Member
    Posted 6 years ago #

    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?

  2. Exavior
    Member
    Posted 6 years ago #

    The message I get when trying to display the "comments_template();" is "Comments are closed."

  3. Exavior
    Member
    Posted 6 years ago #

    Anyone?

  4. Exavior
    Member
    Posted 6 years ago #

    Pretty please?

  5. TrishaM
    Member
    Posted 6 years ago #

    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)?

  6. Exavior
    Member
    Posted 6 years ago #

    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.

    http://www.theavclub.tv/testComments.php?post=2109

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.