Title: Working with shortcode libraries
Last modified: January 29, 2019

---

# Working with shortcode libraries

 *  Resolved [danatwork](https://wordpress.org/support/users/dkuzmicki/)
 * (@dkuzmicki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/)
 * Hey this is a great addon.
    I’m having a fairly simple issue I think, but I’ve
   spent a few hours on it to no avail.
 * I’m currently displaying a library like this with the correct taxonomy.
    `[mla_gallery
   attachment_tag="Pen Swap" posts_per_page=12 mla_alt_shortcode=su_custom_gallery
   link="lightbox"]`
 * But I’m trying to merge this with the display style/output of something like 
   this:
    `[su_custom_gallery source="posts: recent" limit="40" link="lightbox"]`
 * I basically just keep getting **Custom Gallery: images not found**
 * thank you for your support!

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

 *  Thread Starter [danatwork](https://wordpress.org/support/users/dkuzmicki/)
 * (@dkuzmicki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11145881)
 * I should add the the mla_alt-shortcode tags and link tags in the first code segment
   aren’t working
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11146061)
 * Thanks for your question and for including the details on your shortcodes; very
   helpful.
 * You do not say what theme or plugin you are using for the `[su_custom_gallery]`
   shortcode so I can’t investigate further to see what parameters the `[su_custom_gallery]`
   supports. if it’s a free theme/plugin I can try installing it on my own system.
   If not, can you point me to more documentation on it?
 * The `mla_alt_shortcode=su_custom_gallery` essentially breaks the gallery generation
   process into two pieces. First, MLA uses data selection parameters such as `attachment_tag
   ="Pen Swap"` and `posts_per_page=12` to find the items for the gallery. MLA generates
   a list of the item ID values, something like `ids=1,2,3', and passes this to 
   the alternate shortcode along with the other parameters such as`source=”posts:
   recent”` for formatting the gallery display.
 * It looks like you have two possible problems. First, your example includes `attachment_tag
   ="Pen Swap"`. The `attachment_tag` parameter requires the term <strong>slug</
   strong> value, not the term name; try something like `attachment_tag="pen-swap"`.
   Second, it looks like the `[su_custom_gallery]` does not accept an `ids` parameter
   with a list of items for the gallery display. It might be using the `source="
   posts: recent"` parameter instead and not finding any items.
 * Regarding your second post, the “tags” issue might be the name/slug confusion.
   The “link” issue might be that MLA is not generating the links and the `link`
   parameter is ignored when `mla_alt-shortcode` is present. It is up to the `[su_custom_gallery]`
   shortcode to generate whatever links or parameters are required to activate the
   lightbox features.
 * I will leave this topic unresolved for now in case you have more information 
   or problems/questions regarding the above suggestions. Thanks for your interest
   in the plugin.
 *  Thread Starter [danatwork](https://wordpress.org/support/users/dkuzmicki/)
 * (@dkuzmicki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11146215)
 * Hey!
    appreciate the quick turnaround time. This is working fine and pulling 
   the correct info: `[mla_gallery attachment_tag="Pen Swap"]`
 * What I’m trying to do is to use the built-in **shortcode ultimate** Gallery.
   
   The Shortcode generated by default looks like this: `[su_custom_gallery source
   ="posts: recent" limit="40" link="lightbox"]`
 * My assumption is that I need to build a new shortcode that looks _something_ 
   like this:
    `[mla_gallery mla_alt_shortcode=su_custom_gallery attachment_tag="
   Pen Swap" link="lightbox"]`
 * Hopefully this provides some more clarity.
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11146507)
 * Thanks for your update with the additional information.
 * You wrote “**_What I’m trying to do is to use the built-in shortcode ultimate
   Gallery._** The `[su_custom_gallery]` shortcode is not built-in to WordPress.
   I was able to find this plugin:
 * [Shortcodes Ultimate](https://wordpress.org/plugins/shortcodes-ultimate/)
 * It looks like this is the shortcode you are using:
 * [Custom Gallery](https://getshortcodes.com/shortcodes/custom_gallery/)
 * Is this plugin running on your site and providing the `[su_custom_gallery]`?
 * Your assumed solution looks about right, but `[su_custom_gallery]` requires a
   somewhat unique parameter to specify a list of item ID values, something like`
   source="media: 1650,1648,1649"`. MLA’s alternate shortcode support will not work
   as-is, but the problem can be solved with a small bit of custom code added to
   your theme or a small custom plugin. This would be a (nuch simpler) variation
   on the plugin created for this earlier topic:
 * [Featured Image (Post_thumbnail)](https://wordpress.org/support/topic/featued-image-post_thumbnail/#post-4433316)
 * If you can confirm that the information above is correct I can investigate further.
 *  Thread Starter [danatwork](https://wordpress.org/support/users/dkuzmicki/)
 * (@dkuzmicki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11151575)
 * Hey- everything above is correct.
 * I think that using a different support plugin for displaying a gallery would 
   be easier though.
 * I think the trick would be to use one that is both shortcodes ultimate and MLA
   friendly? I’m trying to keep the instance fairly customization light to keep 
   it maintainable.
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11159518)
 * Thanks for confirming my understanding of your application.
 * After thinking about your requirements and how to adapt them for other MLA users
   I decided to add a new feature to the official MLA release rather than develop
   a custom plugin. I have added a new parameter to the “Support for Other Gallery-
   generating Shortcodes”:
 * >  **mla_alt_ids_template** – (optional) a Content Template for the entire parameter
   > value passed to the alternate shortcode. When processing the template, the 
   > list of ID values is available as the {+alt_ids+} substitution parameter. See
   > the example below.
 * The example selects items assigned to a taxonomy term and uses the Shortcodes
   Ultimate plugin’s Custom gallery shortcode to display the gallery with a lightbox
   enhancement. The `mla_alt_ids_name` and `mla_alt_ids_template` parameters change
   the “ids” and attachment ID defaults to the “source” and “media:” values expected
   by the `[su_custom_gallery]` shortcode:
 *     ```
       [mla_gallery attachment_tag="Pen Swap" link="lightbox" mla_alt_shortcode="su_custom_gallery" mla_alt_ids_name="source" mla_alt_ids_template="media: {+alt_ids+}"]
       ```
   
 * I have uploaded a new MLA Development Version dated 20190201 that contains the
   new feature. You can find step-by-step instructions for using the Development
   Version in this earlier topic:
 * [PHP Warning on media upload with Polylang](https://wordpress.org/support/topic/php-warning-on-media-upload-with-polylang/#post-9625341)
 * If you get a chance to try the Development Version please let me know how it 
   works for you. Thanks for motivating this useful MLA enhancement.
 *  Thread Starter [danatwork](https://wordpress.org/support/users/dkuzmicki/)
 * (@dkuzmicki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11159717)
 * [@dglingren](https://wordpress.org/support/users/dglingren/)
    Seriously. Works
   like a charm out of the box. Perfect instructions 🙂
 * Works with su_slider, su_carousel, su_shortcode.
 * A hundred thank you’s kind sir.

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

The topic ‘Working with shortcode libraries’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [danatwork](https://wordpress.org/support/users/dkuzmicki/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/working-with-shortcode-libraries/#post-11159717)
 * Status: resolved