Support » Fixing WordPress » Gallery not working in Posts & How Do I Edit Gallery Display Properties?

  • I have two gallery-related issues.

    Issue 1:

    I create a post and insert images from the Media Library tab by clicking the “show” link for each image and clicking “Insert into Post”

    The images correctly insert into the post, but when I click the upload image button again, a gallery tab fails to appear.

    Since doesn’t show up, I can’t use the gallery function.

    However, when I create a page (not a post), this sequence of events produces a gallery tab. Why does a difference exist? How do I fix this problem?

    Issue 2:

    I used the gallery shortcode function to create a post image gallery. When it shows up on the page, the default formatting appears: gray outlines, captioned gallery items. I would like to have control over how WordPress formats its gallery items. How do I change these values? I want no outlines, no spacing, no captions.

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


    Forum Moderator

    1. You need to upload your images whilst creating/editing the post. Not via the Media Library.

    2. If you don’t want captions in your gallery, don’t add captions to your images. To remove the default styling from the pages, try adding:

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

    to your theme’s functions.php file. Then add your own styling via your theme’s stylesheet.

    Hi esmi,

    thanks for your help! I was able to figure out the formatting problem – i finally found and edited the original settings location in wp-include/media.php.

    that said, your response to the first issue touches upon a deeper set of issues i have with the gallery function, because it goes against the documentation. it’s advertised to automatically work regardless. see for the following:

    “A gallery will display a set of thumbnail images attached to a particular post or page. If you upload images using the Add an Image button while editing/creating the post or page, they will be attached automatically. If you upload images directly to the media library from Media -> Add New, you will need to attach them to a post or page before they will appear in a gallery.”

    Your solution refers to the first course of action, but they mention that you can add images that already exist in a media library.

    I find the gallery function to be a great start – so much so that in designing my page, i eschewed plugin gallery options because i tend to prefer using native functions. however, there are some real frustrating roadblocks like this one, and i think they could all be solved if you can enable the following functionality to gallery/image management:

    1) in the media library management page you can only attach images to posts and pages, but you can’t detach them. Why is that? what if you wanted to detach an image from a page to move it to another, or to simply let it stay offline until later usage? if i try to remove something from a gallery, it deletes the image from the site altogether.

    2) in the post/page media insert view, wouldn’t it be efficient to have attach/detach radio buttons next to the media library items? that way, if i had a whole slew of things to insert at once that already exist in the media library (say, images from other posts that i want to re-use, etc.), i can just go through the library and click on or click off images to attach to the gallery. or, down the line, one can just drag and drop items into the gallery.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gallery not working in Posts & How Do I Edit Gallery Display Properties?’ is closed to new replies.