How can I work with paragraphs in Wordpress?

Wordpress has a filter that automatically adds paragraphs to posts. I can remove this by adding the following code:

// Remove the <p> tags which WP automatically inserts in psots.
remove_filter ('the_content', 'wpautop');

      

The problem is that I am deleting tags <br />

.

So, I am not removing this filter at the moment. My problem is that inside the DIV box I am getting extra space above and below the text (at the beginning / end of the text).

I can manipulate the tag <p>

in css, but again, this will affect all tags <p>

throughout the entire post content.

Any suggestions on what I should do?

+2


source to share


3 answers


I believe this will help you

<?php wpautop( $post, $br = 0 ); ?>

      



the second parameter is boolean and associated with line breaks.

codex link

+1


source


Try removing blank lines after and after in your post.



0


source


I don't think the @mroggle method can work. In the latter case I had this problem, I had to manually insert <br />

s.

0


source







All Articles