strip out after
-
Hi guys,
i am using shortcodes. After each shortcode that is finished by </div> I got br (or br /) tag.
trying to filter them out, but i dont know how.<div class="fullwidth"> <div class="fullwidth-content"> <div class="twocol-one"> content </div><br> </div><br> <div class="twocol-second"> content </div><br> <div class="clearboth"></div> </div><br>seems BR is newline from tinyMCE. And I don’t want loooong shotcode lines.
I am trying to use str_replace OR preg_replace but i cannot create correct $pattern.
Can you help me?
my function
function replace_br($content) { $rep = str_replace("</div><br />", "</div>", $content); return $rep; } add_filter('the_content', 'replace_br');not working. Probably because of white spaces between them, i think
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘strip out after’ is closed to new replies.