Title: Adding div around &quot;the_content&quot;
Last modified: August 19, 2016

---

# Adding div around "the_content"

 *  [figassis](https://wordpress.org/support/users/figassis/)
 * (@figassis)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/adding-div-around/)
 * I am trying to put a transparent background around the text of a post, but I 
   want to leave the post Title outside the background, so in the theme directory(
   picture-perfect theme), in page.php I did:
 *     ```
       <br />
       <?php while (have_posts()) : the_post(); ?><br />
         <div class="post" id="post-<?php the_ID(); ?>"><br />
           <h2 id="the_title"><?php the_title(); ?></h2></p>
       <p>     <div id="post_text"><br />
       	<?php the_content();?><br />
             </div></p>
       <p>  </div><br />
       <?php endwhile; ?><br />
       ```
   
 * When I test, it’s as if I had never written the “<div id=”post_text”>” or its
   closing tag.
 * How can I insert a div around the_content() ?
 * Thank you

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/adding-div-around/#post-1740931)
 * > When I test
 * how are you testing it?
 * did you look into the html code in the browser?
 * can you post a link to your site with the page.php active?

Viewing 1 replies (of 1 total)

The topic ‘Adding div around "the_content"’ is closed to new replies.

## Tags

 * [background](https://wordpress.org/support/topic-tag/background/)
 * [div](https://wordpress.org/support/topic-tag/div/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [the_content](https://wordpress.org/support/topic-tag/the_content/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/adding-div-around/#post-1740931)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
