Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove automatic paragraph from wordpress widget

Tags:

wordpress

I've just done with my first wordpress theme. My problem is, when I create a new text-widget, the output gets automatically added in paragraph and I also see <br /> tag inserted after every line. Can anybody help me here!

I've added remove_filter('the_content', 'wpautop'); to my functions.php but it doesn't worked.

like image 787
Nikhil Phirke Avatar asked Feb 01 '13 18:02

Nikhil Phirke


1 Answers

Maybe this can help you (or others too):

// remove <br> tags from text widget content, from 4.8 version WP adds these tags
remove_filter('widget_text_content', 'wpautop');
like image 76
Harkály Gergő Avatar answered Oct 18 '22 10:10

Harkály Gergő