Title: nested shortcode
Last modified: April 23, 2025

---

# nested shortcode

 *  Resolved [hupe13](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/nested-shortcode-6/)
 * I have configured a “Custom Shortcode” for `gallery` : “`photonic`“. I enabled“
   Nested Shortcodes in parameters”. I wrote a shortcode to create the ids list.
   How to use this shortcode?
 *     ```wp-block-code
       [photonic ids=[my-shortcode to create list of ids] main_size='large' thumb_size='thumbnail' style='square']
       ```
   
 * Or should my shortcode create such `ids=1,2,3,4` ?
 *     ```wp-block-code
       [photonic [my-shortcode to create ids] main_size='large' thumb_size='thumbnail' style='square']
       ```
   
 * Thank you very much.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/nested-shortcode-6/#post-18431658)
 * It should be the first option. That being said, this was functionality that I
   built within the first year of releasing Photonic (14 years back), and I have
   never had anyone use it. Consequently, I don’t know if it still works as designed,
   since I have never touched it after the initial implementation.
 *  Thread Starter [hupe13](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/nested-shortcode-6/#post-18432199)
 * I would have been happy and surprised if it worked. I once had a similar question
   in my forum and couldn’t solve it. Apparently it’s not that easy.
 * I had to move my photos from Google to WordPress, so I am creating a [plugin](https://github.com/hupe13/album-photonic-github)
   now. That’s why I took another look at the Photonic settings and tested this 
   option.
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/nested-shortcode-6/#post-18432357)
 * Have you tried including your shortcode in quotes? It should look like this:
 *     ```wp-block-code
       [photonic ids='[my-shortcode to create list of ids]' main_size='large' thumb_size='thumbnail' style='square']
       ```
   
 * Basically, the list of ids that Photonic uses is in the format `ids='1,2,3,4'`.
 *  Thread Starter [hupe13](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/nested-shortcode-6/#post-18432466)
 * I tried everything, nothing works. After the first `']'` it fails.
 *     ```wp-block-code
       [gallery ids='[album_ids path=mypath]' link='file' main_size='large' thumb_size='thumbnail' style='square']
       ```
   
 * Result: no gallery, but a text
 *     ```wp-block-code
       ‚ link=’file‘ main_size=’large‘ thumb_size=’thumbnail‘ style=’square‘]
       ```
   
 * The shortcode `album_ids` generates a list of ids and is a similar code like 
   [this](https://github.com/hupe13/album-photonic-github/blob/38b246f89c1da968f9d86878cd510bfd605b00f3/album-photonic.php#L32-L49).
 *  Thread Starter [hupe13](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/nested-shortcode-6/#post-18436661)
 * I have now solved it with [pre_do_shortcode_tag](https://github.com/hupe13/album-medialib-github/blob/main/album-medialib.php#L54).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘nested shortcode’ is closed to new replies.

 * ![](https://ps.w.org/photonic/assets/icon.svg?rev=1972449)
 * [Photonic Gallery & Lightbox for Flickr, SmugMug & Others](https://wordpress.org/plugins/photonic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/photonic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/photonic/)
 * [Active Topics](https://wordpress.org/support/plugin/photonic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photonic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photonic/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [hupe13](https://wordpress.org/support/users/hupe13/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/nested-shortcode-6/#post-18436661)
 * Status: resolved