How to add multiple galleries in a WordPress post
gallery shortcode does an excellent job of creating a gallery out of uploaded images for a post. But what do you do if you want to break up the uploaded images into multiple galleries in the same post?
It is easy - all you have to do is use the
include parameter of the
gallery shortcode. First make a list of the ids of images you wanna put in your galleries, get them from Media > Library. Look at their
attachment_ids, that's what we want. The following is an example of how to add multiple galleries per post.
This is my First gallery
This is my Second gallery
When you use the
include parameter, you explicitly specify which images are to be used for the specific gallery. That way you have a very flexible gallery system; not only can you have multiple galleries on a single pages, but those galleries can contain images uploaded for other posts as well.
TLDR: Create customized galleries eg:
[gallery include="12,68,743,62"] (where those numbers are
attachment_ids of the images) and include them in your post.