Remove Inline Style Of WordPress Gallery Shortcode
December 10th, 2011 by Frank • WordPress Tutorials • 4 Comments
Today I'll give you a small tip for the WordPress Gallery. With version 3.1 of WordPress it is possible to replace the inline style of the core, it's done easily with a Filter-Hook. Use this and include your custom style with the Theme in your frontend; no Plugins, CSS or functions in your Theme for this required - easy, but it works and this is the greatest part of WordPress - Hooks for everyone, everywhere
add_filter( 'use_default_gallery_style', '__return_false' );
If you don`t understand the function __return_false() of the WP Core, please read our post for this function.
Info
- Published in WordPress Tutorials
- Tags: Advent Calendar, Code, gallery, PHP, WordPress, WP
- Comment feed
- read: 6461 | today: 2
- leave a Comment


I just need to find a way to get the rid of the inserted clear:both line breaks that works now.
A note when using this technique is that we should implement our own CSS rules. And it's very helpful if we can list the default classes of gallery. I wrote a same post about this here.
@Rilwis: thanks, great ressource with more informations