Change the markdown for comments (output from wp_list_comments)
wp_list_comments(), comments currently have this markdown:
<div id="comment-1" class="comment even thread-even depth-1"> <div class="comment-author vcard"><cite class="fn">Anonymous</cite> <span class="says">says:</span></div> <div class="comment-meta commentmetadata"> <a href="https://example.org/test/#comment-1">December 11, 2020 - 12:03 am</a> <a href="https://example.org/wp-admin/comment.php?action=editcomment&c=1" class="comment-edit-link"> (Edit) </a> </div> <p>Test</p> <div class="reply"> <a rel="nofollow" href="#comment-1" data-commentid="1" data-postid="1133" data-belowelement="comment-1" data-respondelement="respond" data-replyto="Respond " aria-label="Respond " class="comment-reply-link">Svar </a> </div> </div>
How do I change this markdown?
The things I would like to change:
- Make it so the date is not a link
- Remove all
- All the extra properties, that I’m not using (
- Better class naming, like
- Removing all ID and making it ID’s, to avoid potential clashes with other components.
And if you could explain how I could have found this answer myself, then it would be highly appreciated: What I should have looked for in the source code/documentation.
- Read the docs on wp_list_comments
- Diving into the function-definition for
wp_list_commentsin the source-code. But it’s a big function. And nothing came up on when searching for
- Looked at documentation for get_comment_meta (but that was something different, taking a single comment ID as input.