• Hello,
    I hoping that someone can put me in the right direction before I pull my hair out!
    I’m trying to edit the default html that wordpress puts out for the default gallery.
    I’m using the shortcode method to display my gallery on a custom template page. The problem is that wordpress is automatically inputting <br style="clear:both"> into the html markup and it’s messing things up for me! I have been messing with this for hours, literally. I found this on another post:

    function remove_gallery_css()
    {
    	return "<ul class=\"gallery\">";
    }
    add_filter('gallery_style', 'remove_gallery_css');
    
    function fix_gallery_output( $output )
    {
    $output = preg_replace("%<br style=.*clear: both.* />%", "", $output);
    return $output;
    }
    add_filter('the_content', 'fix_gallery_output',11, 1);

    I added this into my functions file and it is STILL adding in the same clear:both style to the
    elements! UGH! Can anyone please help me with this?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress Gallery (shortcode) Markup ISSUE’ is closed to new replies.