So I’m using a custom loop to output a custom post type on some pages.
It works just fine, grabs the content etc, but it doesn’t wrap the paragraphs in p tags.
I’m relatively new to WP, being as though I’ve just done front end stuff before, so forgive me if I’m making an elementary mistake here.
<div class="home-grid-1">
<?php
query_posts(array(
'post_type' => 'Headerhome',
'showposts' => 1
) );
?>
<?php while (have_posts()) : the_post(); ?>
<?php echo get_the_content(); ?>
<?php endwhile; wp_reset_query();?>
</div> <!-- end home-grid-1 -->
Instead of
echo get_the_content()
, which often does not have filters applied to it, usethe_content()
which will automatically echo the post content, with filters applied.The filter you need is a transformer of double-line-breaks to
<p>
and</p>
. It’s called wpaup and is explained here