• Resolved dcnz

    (@dcnz)


    Hi there,

    I have the post content displaying in a custom property overview template but it seems to be stripping out the <p> tags. All other formatting seems to be ok.

    I’ve tried using strip_tags and wp_kses but that doesn’t work.

    Is there any way to make it not strip out <p> tags?

    Thanks.

    https://www.ads-software.com/plugins/wp-property/

Viewing 1 replies (of 1 total)
  • Thread Starter dcnz

    (@dcnz)

    Ok so I found the solution myself. After trying many different things, the answer was actually quite simple. And that was to use wpautop https://codex.www.ads-software.com/Function_Reference/wpautop

    And here’s the code to output the post content and keep the P tags intact:

    <?php if( !empty( $property['post_content'] ) ): ?>
    <div class="property_content"><?php echo wpautop( $property['post_content'] ); ?></div>
    <?php endif; ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Stripped p tags in post content on property-overview’ is closed to new replies.