Is it possible to add classes to content elements?

I am developing a WordPress theme. To display the content I use

while ( have_posts() ) : the_post();
    the_content();
endwhile;

This, as you know, displays the contents as html like

<h1>Title<h1>
<p>Lorem Ipsum</p>

etc. Is it possible to make WordPress add classes to these content elements or even wrap these elements like

<h1 class="col-sm-12">Title<h1>
<p class="col-sm-8">Lorem Ipsum</p>

or

<div class="col-sm-12">
    <h1>Title<h1>
</div>
<div class="col-sm-8">
    <p>Lorem Ipsum</p>
</div>

respectively?

Read more here: Is it possible to add classes to content elements?

Leave a Reply

Your email address will not be published. Required fields are marked *