Home / functions.php / Remove inline style from gallery shortcode
  • How to Remove inline style from gallery shortcode

    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.

    wordpress snippet : PHP

    <>
    add_filter( 'use_default_gallery_style', '__return_false' );
    

    ( WordPress codex functions, hooks, in this snippet. )

    use_default_gallery_style, gallery_style, add_filter, __,
  • 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