Skip to content

Commit 68d31f8

Browse files
authored
Update README.md
1 parent ff55377 commit 68d31f8

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,47 @@
1-
# wp-bootstrap-comment-walker
2-
A custom WordPress comment walker class to implement the Bootstrap 3 Media object in wordpress comment list.
1+
wp-bootstrap-comment-walker
2+
======================
3+
4+
**A custom WordPress comment walker class to implement the [Bootstrap 3 Media object](http://getbootstrap.com/components/#media) in wordpress comment list.**
5+
6+
Installation and Usage
7+
------------
8+
If you haven't already add the HTML5 theme support for comment list, add this first in your `functions.php`
9+
10+
```php
11+
function custom_theme_setup() {
12+
add_theme_support( 'html5', array( 'comment-list' ) );
13+
}
14+
add_action( 'after_setup_theme', 'custom_theme_setup' );
15+
```
16+
17+
Place **class-wp-bootstrap-comment-walker.php** in your WordPress theme folder `/wp-content/your-theme/`
18+
19+
Open your WordPress themes **comments.php** file `/wp-content/your-theme/comments.php` and in this file you should see a snippet like this:
20+
21+
```php
22+
<ol class="comment-list">
23+
<?php
24+
wp_list_comments( array(
25+
'style' => 'ol',
26+
'short_ping' => true,
27+
'avatar_size' => 56,
28+
) );
29+
?>
30+
</ol><!-- .comment-list -->
31+
```
32+
The above snippet copied from the comments.php of twentyfifteen theme. Now replace the similar code in your `comments.php` with this following code:
33+
```php
34+
<ul class="list-unstyled">
35+
<?php
36+
// Register Custom Comment Walker
37+
require_once('class-wp-bootstrap-comment-walker.php');
38+
39+
wp_list_comments( array(
40+
'style' => 'ul',
41+
'short_ping' => true,
42+
'avatar_size' => '64',
43+
'walker' => new Bootstrap_Comment_Walker(),
44+
) );
45+
?>
46+
</ul><!-- .comment-list -->
47+
```

0 commit comments

Comments
 (0)