Forums

How to make comments appear after posts in Twenty Ten (11 posts)

  1. startz
    Member
    Posted 3 months ago #

    How can I make comments appear immediately below posts in theme Twenty Ten?
    (apologies if this is a FAQ. I've looked around before asking...honest.)

  2. marywyar
    Member
    Posted 3 months ago #

    on the main page?

    add:

    <?php $withcomments = 1; ?>
    <?php comments_template(); ?>
  3. startz
    Member
    Posted 3 months ago #

    Thanks. That's a clear answer to my maybe not so clear question.

    When I make the suggested change a form to enter comments appears at the bottom of the page. What I'm looking for is that the displayed comments appear beneath the post their commenting on.

    Sorry for not being more clear the first time around.

  4. alchymyth
    The Sweeper
    Posted 3 months ago #

    that the displayed comments appear beneath the post their commenting on.

    if coments are allowed and open, they should appear below the post content;

    have you allowed comments in settings - discussion and for each individual post/page ?
    (if there is no 'discussion' area below the post editor, open 'screen options' near the top right of the 'edit post' page, and tick 'discussion' then scroll down to below the post editor.. (same for pages))

    it might help if you could post a link to your site to illustrate what is showing.

  5. startz
    Member
    Posted 3 months ago #

    I went back and checked. Under individual posts "Discussion: Allow comments" is checked. In the Dashboard "Settings: Discussion Settings: Allow People to post comments on new articles" is checked.

    What happens is that comments appear, but they are off on their own page rather than with the original post.

    Here's an example:
    http://profitofeducation.org/?p=2816

  6. alchymyth
    The Sweeper
    Posted 3 months ago #

    I can't see anything wrong with the link you posted - comments are there as expected, directly below the post.

    comments will not appear on the index page or in archive pages, by default.

  7. startz
    Member
    Posted 3 months ago #

    Okay...now I'm really confused.
    As you say, if you follow the link I gave the comments show up nicely. But if you go to my home page http://profitofeducation.org/, the comments don't show.

    Is that what "comments will not appear on the index page or in archive pages, by default" means? And if so, is there a way to change it?

  8. alchymyth
    The Sweeper
    Posted 3 months ago #

    And if so, is there a way to change it?

    there are good reasons, not to change it.

    - even if you overwrite the default - see @marywyar's suggestion plus an added global $withcomments; before it, applied to the right location in loop.php - not all comments features such as paginatad comments and comments replies might work properly;
    - with a lot of comments, the load time of the index page will increase.

    proceed at your own risk...

  9. startz
    Member
    Posted 3 months ago #

    Both the advice and the warning are appreciated.

    I have relatively few comments. I think what makes sense is for me to try the change you suggest, while being prepared to back out if things don't go well.

    So if you don't mind, let me ask you for more detailed advice. (I'm reasonably computer literate, but know nothing about the workings of WordPress.)

    I take it I should add
    1.

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

    at the bottom of main index template.

    2.
    global $withcomments;
    in loop.php

    Do I have this right? And, if so, where in loop.php does the second piece go?

  10. alchymyth
    The Sweeper
    Posted 3 months ago #

    just add the whole stuff:

    <?php global $withcomments;
    $withcomments = 1; ?>
    <?php comments_template( '', true ); ?>

    into loop.php, about 10 lines from the end of the file, to replace:

    <?php comments_template( '', true ); ?>
  11. startz
    Member
    Posted 3 months ago #

    alchymth (marywyar too):

    The helping hand is much appreciated. I've been trying to change this for more than a year. You showed me how to do it in one minute.

    Thanks!

Reply

You must log in to post.

About this Topic