WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add threaded/nested comments (9 posts)

  1. lieutenantdan
    Member
    Posted 1 year ago #

    I am currently in the midst of converting a HTML template into a WordPress theme, I've solved most of my problems using the Codex or other threads, but I just can't seem to figure out how to have threaded comments go under the comment they should, anybody?

  2. gnarlyinc
    Member
    Posted 1 year ago #

    Log-in to the wordpress Admin Area.

    Navigate to Settings > Discussion. Make sure enable threaded nested comments is enabled.

    Thats all.

  3. lieutenantdan
    Member
    Posted 1 year ago #

    I dont think you really understand....

    I am making my own wordpress theme, custom comments, not the default theme comments....

    I need to know how to nest the comments using PHP

  4. gnarlyinc
    Member
    Posted 1 year ago #

    Use this on the template page where you want comments to appear.

    <?php comments_template(); // Get wp-comments.php template ?>

    no need for any other php. WordPress automatically puts comments in lists, and will display them as nested if the option is selected. Than just style them with css.

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    can't seem to figure out how to have threaded comments go under the comment they should

    does this mean:

    - you have the 'comments_template()' code in single.php and page.php;
    - you have a comments.php in your theme;
    - and this comments.php is using 'wp_list_comments()' ?

    http://codex.wordpress.org/Function_Reference/wp_list_comments

  6. lieutenantdan
    Member
    Posted 1 year ago #

    @gnarlyinc
    Why cant I do it my own way, WordPress cant do it why can't anyone else...

    @alchymyth
    I've got a comments_template(), with my own custom comments to be listed, I just need to know how to make the comments go in the right place, nobody seems to know though

  7. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    I've got a comments_template(), with my own custom comments to be listed

    do you have a comments.php in your theme?

    if so, paste the full code of comments.php into a pastebin and post the link to it here - see http://codex.wordpress.org/Forum_Welcome#Posting_Code

    I just need to know how to make the comments go in the right place

    without being able to see how it looks right now, nobody can possibly know. please post a link to your site.

    coming back to your earlier remark:

    I need to know how to nest the comments using PHP

    that is done by using 'wp_list_comments()'

  8. gnarlyinc
    Member
    Posted 1 year ago #

    Why cant I do it my own way, WordPress cant do it why can't anyone else...

    You can do it your way, I`m just giving you the easiest way. WordPress can and will list comments, try being a bit mroe clear on what you want to do.

    I've got a comments_template(), with my own custom comments to be listed, I just need to know how to make the comments go in the right place, nobody seems to know though

    comments should be in a list, than the list can be styled with css like any other list, ie set margins, padding, list-style-type, etc. until you get the look you want.

  9. lieutenantdan
    Member
    Posted 1 year ago #

    I ended up using my own function for the comment style, it's located in the codex here in case anyone else needs the solution. Thanks to all who took time out of their lives to help poor old me.

    https://codex.wordpress.org/Function_Reference/wp_list_comments#Comments_Only_With_A_Custom_Comment_Display

Topic Closed

This topic has been closed to new replies.

About this Topic