How to display html in only the first level of WP comments?

How would I display html code in only the first level of threaded comments?

Example
L1 Comment
—-L2 Comment
——–L3 Comment
L1 Comment

Read More

I have a piece of html code that contains basically reads “Reply to (author name) or post a new comment” and only need it displayed on L1 comments.

Related posts

Leave a Reply

1 comment

  1. You can do this in the comments loop:

    if( empty( $comment->comment_parent ) ) { //if the comment does not have a parent, then it is L1
        echo 'my-custom-html';
    }