WordPress.org

Support

Support » How-To and Troubleshooting » insert gallery

insert gallery

  • where is the layout control for “insert gallery” option when adding images. my post’s full-size pix are 500px wide. it would be nice if a three-column gallery would also be 500 px wide.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    @esmi

    Forum Moderator

    There isn’t a gallery layout control button. You can control the width of your gallery via your theme’s stylesheet.

    agreed, no button option. what is the hook, div class, name, for the wp gallery ?? so i can create the css. does it already exist on my stylesheet ?

    esmi

    @esmi

    Forum Moderator

    Depends on the theme. By default, the gallery css is added to the page body – which is actually incorrect. In some themes, this default behaviour has been disabled by adding:

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

    to the functions.php file. The end result is that all of the gallery css has to be in the theme stylesheet – which does make it a lot easier to control.

    I’d suggest checking the source of a gallery page on your site first. If there is css in the body just before the gallery markup, copy it and add it to your theme’s stylesheet. Then disable the default css using the code above in functions.php. At that point, you can start tweaking the css in your stylesheet to suit your purposes.

    Trying to just amend your stylesheet without disabling the default css can be tricky as inline css always trumps an external sheet.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘insert gallery’ is closed to new replies.
Skip to toolbar