Just a simple, beautiful comment walker
A simple comment walker that extends existing WordPress functionality by replacing the html5_comment
function in Walker_Comment
.
This walker should work with all WordPress themes, but we recommend to use Sage by Roots if you’re building from scratch.
For Sage:
/src
folderOther themes:
require_once
to add the walker in to runtimeAfter adding in, using the comment walker is pretty easy. Wherever a wp_list_comments
is located, add 'walker' => new Comment_Walker
and set 'format' => 'html5'
to utilize it. It should look like the following:
wp_list_comments([
'avatar_size' => 50,
'format' => 'html5',
'short_ping' => true,
'style' => 'li',
'walker' => new Comment_Walker
]);
Feel free to contribute to this project. The template could certainly be refactored, and I will come back to it as I work on future projects. I will credit every contributor below.