Adding a div class or id inside the_content()

You have to put your advertisement block just before <?php the_content(); ?> in a separate div-layer and add some css to it. E.g.

single.php

<div class="entry entry-content">
    <div class="advertisement">
        <p>Your advertisement</p>
    </div>

    <?php the_content(); ?>
</div>

CSS

div.advertisement {
    float: left;
    width: 150px;
    padding: 0px 10px 10px 0px;
}

Leave a Comment