X

Remove inline style from gallery shortcode

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.



Code Snippet:


add_filter( 'use_default_gallery_style', '__return_false' );

Comments  Leave a Reply

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

    1.  no problem glad that I could help

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!