Title: Gallery Post Id Shortcode Bug?
Last modified: August 20, 2016

---

# Gallery Post Id Shortcode Bug?

 *  Resolved [jeanne38654](https://wordpress.org/support/users/jeanne38654/)
 * (@jeanne38654)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/)
 * I’m trying to insert multiple galleries into a page. However, when I use this:
 *  [gallery id=”X” ]
 * The wrong images are displayed (no matter what value I put in place of “X”.)
 * So, let’s say I have post ID 123 with 3 images.
    And also post ID of 456 with
   3 images
 * If I put [gallery id=”123”] it does show images – but not the ones associated
   with post ID 123!!! In fact, it is displaying 5 images (the only 5) that are 
   not attached to ANY POST or PAGE! What the heck? Any ideas? Anyone else have 
   this issue? Weird!!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [jeanne38654](https://wordpress.org/support/users/jeanne38654/)
 * (@jeanne38654)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145722)
 * UPDATE – So I attached those 5 “unattached” images to a page. Now the gallery
   shows nothing.
 * So, basically using shortcode [gallery id="x"] is buggy – only shows unattached
   images, not images associated with the post id and if there are not unattached
   images, it shows nothing.
 * Surely someone else has this issue? I’m using WP 3.4.2
 *  Thread Starter [jeanne38654](https://wordpress.org/support/users/jeanne38654/)
 * (@jeanne38654)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145723)
 * And, I just tested this on another installation – standard, clean, using twenty-
   eleven theme. Same problem. Shortcode [gallery id=”X”] does not work. Must be
   that is not correct shortcode – but codex says it is? See this from the codex:
 * “id
    specify the post ID. The gallery will display images which are attached 
   to that post. The default behavior if no ID is specified is to display images
   attached to the current post. For example, to display images attached to post
   123: [gallery id="123"] ” – From [http://codex.wordpress.org/Gallery_Shortcode](http://codex.wordpress.org/Gallery_Shortcode)
 * So………..??
 *  Thread Starter [jeanne38654](https://wordpress.org/support/users/jeanne38654/)
 * (@jeanne38654)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145724)
 * SOLUTION – for anyone else scratching their head trying to figure this out……….
   I had to do it THIS way:
 * [gallery galleryid="xxx"]
 * Which is NOT what the codex says. Only reason I figured that out was looking 
   at source file of original post page and saw galleryid=779…note “galleryid” has
   to be all one literal.
 *  Thread Starter [jeanne38654](https://wordpress.org/support/users/jeanne38654/)
 * (@jeanne38654)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145728)
 * Issue resolved
 *  [anthwinter](https://wordpress.org/support/users/anthwinter/)
 * (@anthwinter)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145905)
 * I am having the same problem and your solution didn’t work for me. This has me
   very confused. (using v3.5.1)
 *  [galeroy](https://wordpress.org/support/users/galeroy/)
 * (@galeroy)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145913)
 * I’m having the same problem (using version 3.6.1). The solution above [gallery
   galleryid="xxx"] didn’t work for me either.
 * It appears that this problem isn’t related to a particular theme or any user 
   mods for a given theme. [gallery id="xxx"] just doesn’t work.
 * If anyone comes up with a solution for this – please post!
 * Thanks!
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145914)
 * **[@galeroy](https://wordpress.org/support/users/galeroy/)** – this thread is
   marked resolved and it’s regarding an old version of WP – please start your own
   thread if you need help – [http://codex.wordpress.org/Forum_Welcome#Where_To_Post](http://codex.wordpress.org/Forum_Welcome#Where_To_Post)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Gallery Post Id Shortcode Bug?’ is closed to new replies.

## Tags

 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [id](https://wordpress.org/support/topic-tag/id/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/gallery-post-id-shortcode-bug/#post-3145914)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
