wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Remove inline style from gallery shortcode

wordpress snippet

The WordPress gallery shortcode will add some inline CSS to your document however if I’m like many of you, I would rather use my own. Adding the above snippet to the functions.php of your wordpress theme will disable the default gallery styles from being inserted into the page.

snippet :  PHPcopy
add_filter( 'use_default_gallery_style', '__return_false' );

Did you like this post? If so please share it with your friends. Thanks!

  • Webminky

    Thanks muchly, been trying to get rid of that for a while!

    • http://wpsnipp.com Kevin Chard

       no problem glad that I could help