How can one picture belongs different galleries?
For example, there are two galleries. I want to avoid loading the image twice (in two galleries) but it shown (included) in the first and second gallery.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
You can use the
include attribute of the
[gallery] shortcode to include the images in your galleries. For example, if you have an image with ID of 6 and you want to include it in two different galleries and in different posts, in the first post you can put:
This include images with IDs: 1, 2 31, and 6. And on the second post:
This include images 7, 12, 45 and 6.
As of WP 3.5, the
ids attribute is included by default in the gallery shortcode, which give you much flexibility in choosing and manipulating images in your galleries, read more in the codex page.