WordPress.org

Ready to get started?Download WordPress

Forums

Adding div around "the_content" (2 posts)

  1. figassis
    Member
    Posted 3 years ago #

    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

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic