Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to place multiple image galleries in a single post?

Please note that:

  1. I would only like to use Wordpress' built-in gallery function, and not something else, like NextGen gallery.

  2. I know that I can group images in a post using [gallery include="23,39,45"] or [gallery exclude="21,32,43"], but the thing is, when the user goes to the attachments page (after clicking a thumbnail in the image gallery in a post), all the images are together. I would like to have two completely different galleries in a single post.

  3. I know that I can create two pages, add the two sets of images that I have, and then add the two image galleries in a post using [gallery id="n1"] and [gallery id="n2"]. I do NOT want to do this, as pages are not meant for this (unless, of course, there's no way around).

  4. There are plugins that claim to do this, but most of them:

    • Only group images, like I mentioned in point (2).

    • Others have been developed at least 6 months ago, and the questions by users in the support forums are left unanswered by the plugin authors. So, they are a no-go for me.

Is there at all a way to post multiple image galleries in a single post? It would be awesome if there's. Thanks.

share|improve this question
    
How do you want to sort the gallery's? This is the underlying problem. –  Wyck Feb 27 '12 at 16:22
    
@Wyck I know that galleries are sorted by post / page ID. But I wanted to know if there's a workaround that someone who can code can bring forth. –  its_me Feb 27 '12 at 18:25

2 Answers 2

up vote 1 down vote accepted

No, because galleries are defined as being all the images attached to a single Post. Therefore one Post cannot have multiple galleries because that goes against the definition of what a "gallery" is.

Your method #3 will be as close as you can get, however you don't have to use Pages specifically. You can use Posts to separate galleries as well.

share|improve this answer

For the time being (until someone has a workaround), here's what I am doing — step-by-step:

1. Created a new category titled "Gallery"

2. The category is hidden from homepage only (and not category pages) using this code — (MORE INFO):

<?php query_posts($query_string . '&cat=-ID'); ?> (replace ID with the category ID)

Which is added right above:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> in index.php

3. This means, I now have a category page showing off all the galleries. I think it's cool. If you don't think so, just don't mention that category in menus, or link to it anywhere on your website. Basically, then people won't know that it even exists. It doesn't matter if Google comes to know of it, you won't be penalized.

4. Exclude 'Gallery' category from the main RSS feed. There are many ways to do that; more info HERE and HERE.

5. Based on your theme, you may have to make some changes elsewhere, like "Latest Posts" or "Popular Posts" widgets. And I guess, most of us have to deal with it.

6. And then again, based on your intentions, you may also want to omit one of the steps mentioned above.

This is the closest I can think of, as I can't code. There are plugins that do exactly what we want here, but they are too new with too many downvotes, or lack any support from the plugin author in the forums. FWIW.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.