wordpress snippets last updated   : April 22, 2014
we now have 631 snippets

Gallery shortcode remove css

wordpress snippet

Adding this PHP code to your function.php will remove the CSS wordpress adds when using the gallery shortcode.

snippet :  PHPcopy
<?
         add_filter('gallery_style', create_function('$a', 'return "<div class=\'gallery\'>";'));
?>

  • http://twitter.com/eduplessis Edouard Duplessis

    more easy

    add_filter(‘use_default_gallery_style’, FALSE);

    • http://wpsnipp.com Kevin Chard

      Ahhh slick thanks.

    • Khaled Attia

      Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in WORDPRESS_PATHwp-includesplugin.php on line 166

      • Khaled Attia

        This work
        add_filter(‘use_default_gallery_style’, create_function(”,’return FALSE;’));

        • Rodrigo

          add_filter(‘use_default_gallery_style’, ‘__return_false’);
          wordpress has his own function for this cases, don’t need hack with lambda-style functions

jqsnipp.com | we just launched jquery snippets website