Home>Support>Filtering text widget

Filtering text widget

So here is my problem.
I have a 2 column row with a text widget in each. In the right widget i have nothing but a native wordpress gallery. The thing is: the auto-p function is creating empty p tags above and below the gallery and the buttom margin on my p tags screws up the top and buttom margins of the column.

I thought i had it sorted with this filter but i can’t get it to work. Any help?

// Remove empty auto  (with no class or similar) NOT WORKING
function filter_empty_ptags($content){
   return preg_replace('/

/', '', $content);
}

add_filter('widget_text', 'filter_empty_ptags');

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More