Styling the user comments on your pages
WordPress enables your users to comment on your blogs. The JBST theme uses Bootstraps' Media object to display the comments. The media object is an abstract element used as the basis for building more complex and repetitive components. You can use it to style a HTML list too. HTML lists are useful to display comments threads.
In the JBST 4 theme, the comments.php
file in the main theme folder contains the HTML and PHP code for the comments. The comments.php
file is part of WordPress template system as described before. It contains the following PHP snippet:
<ol class="commentlist"> <?php wp_list_comments ('type=comment&callback=jbst4_comments'); ?> </ol>
The jbst4_comments
callback function to display the comment list can be found in the assets/functions/comments.php
file, it contains the following HTML and PHP code:
<?php // Comment Layout function jbst4_comments($comment, $args, $depth...