The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Comment Form Outside of WP (3 posts)

  1. hauf9301
    Posted 3 years ago #


    Is there a way to display the comment form in a directory outside of WordPress?

    I want to display the form in my loop in the following file
    /index.php (one dir higher then WP install)

    WordPress is installed in the following directory:

    I am using the following code:

    <?php require('blog/wp-blog-header.php'); ?>
    <?php query_posts('showposts=3&category_name=test'); ?>
    <?php while (have_posts()) : the_post(); ?>
        <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
        <?php the_content(); ?>
        <?php comments_popup_link('no comments', '1 comment', '% comments'); ?></p>
        <?php $withcomments=true; comments_template(); ?>
    <?php endwhile; ?>

    But even though I am logged in I see "You must be logged in to comment." instead of a comment form.


  2. hauf9301
    Posted 3 years ago #

    Is this not possible?

  3. Peter_L
    Posted 3 years ago #

    Use wordpress functions outside of wordpress... of course not.

Topic Closed

This topic has been closed to new replies.

About this Topic