So I have this idea in mind: I would like to create custom page template, and whenever in post gallery is between tags, for example:

Lorem ipsum somethinginkgsd....

Gallery here

I would like to convert this gallery to a carousel.

Creating carousel is fairly simple I guess. I just need something like get_post_gallery_images, but:

  • get_post_gallery_images will only return first gallery in post
  • this would still render gallery inside a post.

So my question is: how to get exactly the one gallery between [carousel] tags, and how to replace it?

Thank you a lot for any help!

  • 1
    which gallery you want to display and what have you tried yet
    – terminator
    Jan 31, 2015 at 16:38

1 Answer 1


Use the same gallery shortcode generated in the visual editor, then add an attribute to note carousel. That way you piggyback on all the functionality with very little extra effort required.

 [gallery carousel="true" link="none" size="medium" ids="378,377,376,375,374,373"]

See this answer for how to approach this by replacing the default gallery shortcode.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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