Book Image

Bootstrap 4 Site Blueprints - Second Edition

By : Ian Whitney, David Cochran
Book Image

Bootstrap 4 Site Blueprints - Second Edition

By: Ian Whitney, David Cochran

Overview of this book

Packed with trade secrets, this second edition is your one-stop solution to creating websites that will provide the best experience for your users. We cover six popular, real-world examples, where each project teaches you about the various functionalities of Bootstrap 4 and their implementation. The book starts off by getting you up and running with the new features of Bootstrap 4 before gradually moving on to customizing your blog with Bootstrap and SASS, building a portfolio site, and turning it into a WordPress theme. In the process, you will learn to recompile Bootstrap files using SASS, design a user interface, and integrate JavaScript plugins. Towards the end of the book, you will also be introduced to integrating Bootstrap 4 with popular application frameworks such as Angular 2, Ruby on Rails, and React.
Table of Contents (15 chapters)
Bootstrap 4 Site Blueprints
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface

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...