hey guys, i really need your help.
Whenever I use a gallery in wordpress and set it's columns to just 1 Wordpress automatically adds <br style="clear: both"/>
after every <dl class="gallery-item">
. I really need to prevent this behaviour and therefore I'd like to add a filter to my functions.php
The following to examples don't work.
add_filter( 'post_gallery', 'remove_br_gallery', 9);
function remove_br_gallery($output) {
return preg_replace('#\<br*.?\>#is', '', $output);
}
add_filter( 'the_content', 'remove_br_gallery', 9);
function remove_br_gallery($output) {
return preg_replace('#\<br*.?\>#is', '', $output);
}
Neither does this:
return str_replace('<br style="clear: both">', '', $output);
Any idea how I could solve that? I just don't want to have any <br style="clear: both"/>
inside of my galleries.