WP Manifestindependent plugin directory
manifest / themes / wp-bootstrap-comment-walker

WP Bootstrap Comment Walker

A custom WordPress comment walker class to implement the Bootstrap 3 Media object in wordpress comment list.

★ 10stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/wp-bootstrap/wp-bootstrap-comment-walker/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A custom WordPress comment walker class to implement the Bootstrap 3 Media object in wordpress comment list.

Installation and Usage

If you haven't already add the HTML5 theme support for comment list, add this first in your functions.php

function custom_theme_setup() {
    add_theme_support( 'html5', array( 'comment-list' ) );
}
add_action( 'after_setup_theme', 'custom_theme_setup' );

Place class-wp-bootstrap-comment-walker.php in your WordPress theme folder /wp-content/your-theme/

Open your WordPress themes comments.php file /wp-content/your-theme/comments.php and in this file you should see a snippet like this:

<ol class="comment-list">
    <?php
        wp_list_comments( array(
            'style'       => 'ol',
            'short_ping'  => true,
            'avatar_size' => 56,
        ) );
    ?>
</ol><!-- .comment-list -->

The above snippet copied from the comments.php of twentyfifteen theme. Now replace the similar code in your comments.php with this following code:

<ul class="list-unstyled">
    <?php
        // Register Custom Comment Walker
        require_once('class-wp-bootstrap-comment-walker.php');

        wp_list_comments( array(
            'style'         => 'ul',
            'short_ping'    => true,
            'avatar_size'   => '64',
            'walker'        => new Bootstrap_Comment_Walker(),
        ) );
    ?>
</ul><!-- .comment-list -->