Code Snippets → WordPress → Remove Gallery Inline Styling Remove Gallery Inline Styling Chris Coyier on Jan 25, 2012 add_filter( 'use_default_gallery_style', '__return_false' );
Simple and usefull … thanks!
Doesn’t work in WordPress 3.6, inline styles are still there.
Oh! Works great in 3.9
Added this to my theme’s functions.php. Seems simple enough, but doesn’t work for me. (I’m using WordPress 3.9.1 with a child theme based on Twenty Eleven 1.2.)
Anyone else have problems?
Not working in WP 4.1-alpha :/
Dude, you are the Splinter to my Ninja Turtle.
I created a function just to get rid of the WP injected inline style, and then spent all day trying to make that function work without breaking a bunch of other stuff…then I found this. This super simple, completely effective filter. I’m kicking myself for the time I wasted today. I know better: always check on css-tricks first.
Thank you for being awesome!
If you’re having problems then check this out for a modern tip to control the styles (although for me the original method in this article did work, it just removed too many of the styles)
Just for some pedantry—we are talking about “internal” styles, not “inline”, right?
And the “modern version” works great: