Multiple Galleries in a single post / page

  • Author
  • #967000

    Hi there,

    I read an interesting post from timethief answering a question about how to get round the issue of having multiple galleries on a single page with different images on each. It introduced me to using the INCLUDE and EXCLUDE tags within the editor which was great.

    So I am putting together a post at the moment. It will have 3 images dotted around as single inserted files, then ideally 4 other galleries with anything from 3 to 7 images in each, all of these being separate of course.

    So I use the include function to specify the ones I want in Gallery 1. That works fine. A little bit further down the page I add in new images that I want to be put in Gallery 2, but the only option I have is to update the existing gallery rather than add a new one.

    I did deviate a little from timethief’s original suggestion. I did not attach all the media to the page at the start, I added in stuff just for ease of management specific to the second gallery later. I used a Menu Order for the first gallery and I also used the INCLUDE rather than the EXCLUDE function in the first one, not sure if that makes a difference.

    So the bottom line is can I add in another gallery that I can then specify different criteria for?


    The blog I need help with is


    Incidentally I tried inserting a [gallery include] instruction in the Editor where I wanted this second gallery to be, specifying the media images I wanted in this one.

    The format matches the first, functioning one, but nothing is displayed for the new ones. I have seen mentions of Gallery ids, is this specific to this problem?





    I did deviate a little from timethief’s original suggestion. I did not attach all the media to the page at the start…

    You should upload them at the same time to the post or page where you want them to appear and then use “includes” in order to split your photos into groups within the post or page.

    The gallery shortcode will need to be modified in the HTML/Text tab of the Post Editor so that it looks something like this:
    [gallery include="1426,1494,1457"]
    your additional text between the next set of pictures, then
    [gallery include="1428,1454,1493"]
    and so on, the numbers being the image ID number. You can’t do this in the Visual Editor. To find the image ID number you need to be in the Media Library, either click or hover your cursor over the image title and look at the number that comes after “attachment_id=”

    If there are certain images you want to display on their own and not in the Gallery, just insert them in the same way you would add a single image (Add media, browse to Media Library tab, pick your size and “insert in post”).

    You can read more about using the Gallery here:

    Even more here:

    and there are demos here:



    And if you are referring to this post justpi’s advice about creating multiple galleries in a single page or post by using the page ID# is also possible. However, if you are talking about 3-7 images only in each group of photos, I feel it can get cumbersome to create a new published page each time for each group of photos.

    However, if that is your preference, create a new Page, upload your photos, insert your Gallery and publish your Page. Head to the Pages Dashboard, hover your cursor over the newly created Page and note the ID# Once you have that information, head back to your Post and insert the Gallery shortcode in the HTML/Text Editor like this
    [gallery id="423"]

    That published Page will show up in the navbar, unless your theme supports using Custom Menus. See here on how to create a Custom Menu

The topic ‘Multiple Galleries in a single post / page’ is closed to new replies.