• Hi,

    I’ve looked for solutions to this, but maybe not in the right places. If anyone has any ideas, please enlighten.

    Here is the problem. WordPress automatically inserts a line break before the paragraph tag in the following example.

    Here is the php:

    <?php query_posts("cat=6&order=ASC"); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
    <div class="entry">
    <?php the_content(''); ?>
    </div>
    <p class="right"><?php edit_post_link('Edit'); ?></p>
    </div> <!-- end div "post" -->
    <?php endwhile; ?>
    <?php else : ?>
    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn’t here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    <?php endif; ?>

    Here is the html rendering:

    <div class="post" id="post-27">
    <h2>Mission Statement</h2>
    <div class="entry">
    <br/><p>Text goes here.</p>
    </div>
    <p class="right"><a href="#" title="Edit post">Edit</a></p>
    </div> <!-- end div "post" -->

    I don’t understand why that <br/> is appearing in front of the paragraph tags. Any help would be high appreciated.

    Thanks!

  • The topic ‘loop inserting line break’ is closed to new replies.