WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] TwentyTen: ADD COMMENTS FORM to posts on the index page (5 posts)

  1. grimmothy
    Member
    Posted 3 years ago #

    I am doing my best to be able to add the comments and the comment form after each individual post on the homepage which is using the loop.php file to grab the posts from all categories.

    The tag

    <?php comments_template( '', true ); ?>

    seems to be already placed in that loop.php file, but it's not triggering a comment form or anything, does anyone know how to do this? Example here... http://www.prophotoblogs.com/demo1/

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Try replacing:

    <?php comments_template( '', true ); ?>

    with:

    <?php $withcomments=1;
    comments_template();?>

    in the 3rd Loop in loop.php

  3. grimmothy
    Member
    Posted 3 years ago #

    Hello esmi,
    I went ahead an replaced the code, it still is not displaying the comments or the form. Do you think it may be a value in the loop.php file that is voiding out any tags calling for the comments or the form to be displayed?

    Here is the website using TwnetyTen brittanymirabal.com

    AND THE CODE FOR LOOP.PHP

    [Code moderated as per the Forum Rules. Please use the pastebin]

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    @esmi's suggestion will work, it just needs a 'global $withcomments;' added:

    <?php global $withcomments;
    $withcomments=1;
    comments_template();?>
  5. grimmothy
    Member
    Posted 3 years ago #

    Thank you guys it worked!

Topic Closed

This topic has been closed to new replies.

About this Topic