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.
Comments
4 responses to “Remove Inline Style Of WordPress Gallery Shortcode”
I just need to find a way to get the rid of the inserted clear:both line breaks that works now.
[…] first” werden vier wichtige Faktoren formuliert, vier Ws in Anlehnung an den Journalismus. WPEngineer stellt einen kleinen Filter vor, der Inline-Styles in der WordPress-Gallery […]
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