Grow your CSS skills. Land your dream job.

Last updated on:

Remove Gallery Inline Styling

add_filter( 'use_default_gallery_style', '__return_false' );

Reference URL


  1. Vitor Melo


  2. Simple and usefull … thanks!

  3. Tyler
    Permalink to comment#

    Doesn’t work in WordPress 3.6, inline styles are still there.

  4. Metacrawl
    Permalink to comment#

    Oh! Works great in 3.9

  5. BuffaloChuck
    Permalink to comment#

    Added this to my theme’s functions.php. Seems simple enough, but doesn’t work for me. (I’m using WordPress 3.9.1 with a child theme based on Twenty Eleven 1.2.)

  6. Not working in WP 4.1-alpha :/

Leave a Comment

Posting Code

  • Use Markdown, and it will escape the code for you, like `<div class="cool">`.
  • Use triple-backticks for blocks of code.
      <h1>multi-line block of code</h1>
      <span>be cool yo.</span>
  • Otherwise, escape your code, like <code>&lt;div class="cool"&gt;</code>. Markdown is just easier though.

Current ye@r *

*May or may not contain any actual "CSS" or "Tricks".