in WordPress

Stop WordPress Automatically Adding br

WordPress uses a function called wpautop to automatically add paragraphs and line breaks to your content from the content editor. This will change double line breaks and convert them into a HTML paragraph.

<?php wpautop( $foo, $br ); ?>

This takes two parameters the first being the text that needs to be converted, the second being a boolean value, defaults to true which will take line

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email