WordPress-Christmas-2010-10

Remove Inline Style Of WordPress Gallery Shortcode

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 are closed.

4 comments

  1. Mike

    I just need to find a way to get the rid of the inserted clear:both line breaks that works now.

  2. Rilwis

    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.

  3. Frank

    @Rilwis: thanks, great ressource with more informations

One pingback

  1. Adventskalender am 10. Dezember « F-LOG-GE