Forums

Image outside the loop (4 posts)

  1. absence
    Member
    Posted 1 year ago #

    Hello,

    I'm currently working on my exams, and I'm using wordpress to display some of my "clients" work.

    The thing is, I want my image outside the <p> tags the loop creates.
    Like this:

    <div id="prosjekt">
     <img src="myImage.jpg" />
      <div id="info">
       <h2>Title</h2>
       <p>Paragraph</p>
      </div>
    </div>

    However, when I don't want a static image, I end up with this:

    <div id="prosjekt">
      <div id="info">
       <h2>Title</h2>
       <p><img src="myImage.jpg" />Paragraph</p>
      </div>
    </div>

    Is it posible to get the image outside the paragraph tags, if you insert it with the post editor?

    Actual WP-code:

    <div id="prosjekt">
     <div id="info">
      <h2><?php the_title(); ?></h2>
      <?php the_content(); ?>
     </div>
    </div>

    Thank you.

  2. Rbto
    Member
    Posted 1 year ago #

    I'm having the same problem.

  3. Rbto
    Member
    Posted 1 year ago #

    Hey, I found this. I haven't tested it yet. But it seems to solve the problem nice. It does a replace on the server side.

    http://wordpress.stackexchange.com/questions/7090/stop-wordpress-wrapping-images-in-a-p-tag

  4. alchymyth
    The Sweeper
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic