Title: Simple Shortcodes
Last modified: August 21, 2016

---

# Simple Shortcodes

 *  Resolved [sassyfrass475](https://wordpress.org/support/users/sassyfrass475/)
 * (@sassyfrass475)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/simple-shortcodes/)
 * This plugin looks like it could be useful. However the extensive documentation
   is quite overwhelming (especially to regular wordpress users) and seems to list
   only examples of incredibly complicated shortcodes. (Most of which regular users
   do not need.)
 * Can someone lists a few simple, commonly used shortcodes?
 * **SHORTCODE SUGGESTIONS**
    – Shortcode to display the contents of a single category.–
   Shortcode to display the contents of a single tag. – Shortcode to display all
   categories, with each category represented by a single thumbnail with its main
   image. – Shortcode to display all tags, with each tag represented by a single
   thumbnail with its main image.
 * [https://wordpress.org/plugins/media-library-assistant/](https://wordpress.org/plugins/media-library-assistant/)

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

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/simple-shortcodes/#post-5038627)
 * Thanks for your interest in the plugin, for your comments and for your suggestions.
   The Documentation issues have come up before, and you may find these earlier 
   topics useful:
 * [Newbies](http://wordpress.org/support/topic/newbies)
 * [Is there doc that shows how to use this plugin?](http://wordpress.org/support/topic/is-there-doc-that-shows-how-to-use-this-plugin)
 * Since your suggestions include category and tag examples, you may also be interested
   in this topic:
 * [Question for Media Library Assistant users](http://wordpress.org/support/topic/question-for-media-library-assistant-users)
 * Categories and Tags are built-in WordPress “taxonomies” and have been used for
   a long time to organize posts and pages. WordPress does not have built-in support
   for using them with attachments, and that was one of the original motivations
   for MLA.
 * With MLA you can extend Categories and Tags support to attachments. MLA also 
   provides two additional taxonomies for your convenience, Att. Categories and 
   Att. Tags. Because of the way WordPress works, using Categories and Tags for 
   attachments as well as posts and pages can be complicated, so many people find
   that using the separate Att. Categories and Att. Tags is more convenient.
 * To use a taxonomy you must create one or more “terms” within it. For example,
   you could create terms in the Category taxonomy like “Big Dog” and “Little Dog”.
   For each term, WordPress automatically creates a “slug”, e.g., “big-dog” and “
   little-dog” for the previous examples. Removing capital letters, spaces and punctuation
   makes it easier to organize and search the database. It’s the slug you can use
   in `[mla_gallery]` shortcodes.
 * Your first suggestions say “**_display the contents of a single category/tag_**“.
   I understand that to mean “display the attachments that have been assigned to
   a single category/tag”. The easiest way to do this is by slug; for the four taxonomies
   we’ve discussed:
    - Categories: `[mla_gallery category_name=big-dog]`
    - Tags: `[mla_gallery tag=big-dog]`
    - Att. Categories: `[mla_gallery attachment_category=big-dog]`
    - Att. Tags: `[mla_gallery attachment_tag=big-dog]`
 * The `category_name` example does not follow the general rule of “taxonomy-slug
   = term-slug” because it was created long ago, when Categories and Tags were the
   only taxonomies allowed.
 * Your third and fourth suggestions are more complicated. Two questions come to
   mind:
    1. You can use the `[mla_tag_cloud]` shortcode to display the term Titles in a 
       variety of ways, but there is no support in WordPress or MLA for term “thumbnails”
       or any way to designate a term’s “main image”. What do you imagine the main 
       image would be?
    2. What, if anything, should happen when you click on one of the term Titles/thumbnails?
       WordPress supports “archive pages” for posts and pages, but there is no built-
       in support for “attachment archive pages”.
 * The most common answer to the second question is “go to a page that displays 
   a gallery of the attachments assigned to the term.” If that’s what you want, 
   you will have to create the page and set up an `[mla_gallery]` shortcode on the
   page to display the results. The examples in the Documentation do that, but they
   are complicated by including the logic required to divide the resulting gallery
   into pages. I can develop a simpler, single-page version of the example if that
   would help you.
 * Thanks again for your interest and your patience in reading through this response.
   If you can answer the two questions above I would be happy to work on an answer
   to your specific needs. I will leave this topic unresolved until I hear back 
   from you.
 *  Thread Starter [sassyfrass475](https://wordpress.org/support/users/sassyfrass475/)
 * (@sassyfrass475)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/simple-shortcodes/#post-5038663)
 * Thank you for your response. You answered my first two questions perfectly. That
   was just what I needed!
 * As for the last two questions…
 * 1. How do you display the term titles? Is that just the regular tag cloud, with
   big and small tags? Or does it generate a list of the tags or something?… I was
   thinking that a tag’s thumbnail could be an image chosen from within its tag.
   Or maybe simply the first image in the tag. (Like how the NextGen Gallery plugin
   does for it’s galleries.)
 * 2. It would be great if, when I clicked on the thumbnail, it either opened up
   a picture viewer right there to browse through that tag or category’s attachments.
   Or if it did, as you suggested, “go to a page that displays a gallery of the 
   attachments assigned to the term.” And when you click on any of the attachments
   in the gallery, it opened the picture viewer there, where you could browse through
   the images. Where in the documentation are those instructions? I think I’ll have
   too many attachments to show on one page, so the multi-page option is probably
   best. (But, if it’s not too much trouble, can you also supply the single page
   shortcode, too?)
 * Thanks for the help!! (PS: I didn’t mean to sound so harsh in my first post. 
   I meant to add “Thanks for the plugin!” But couldn’t figure out how to go back
   and edit it. Thanks again!)
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/simple-shortcodes/#post-5038674)
 * Thank you for your kind words (I didn’t take your original post as harsh), this
   response and the additional details for your suggestions.
 * With regard to your points:
    1. The `[mla_tag_cloud]` term titles are displayed as the usual cloud with varying
       sized text depending on popularity. You can customize the display in many ways;
       list and grid outputs are available, varying size can be changed, etc. The current
       MLA version does not support thumbnail images, but I will consider this for 
       a future enhancement, and I will look at the NextGen example.
    2. I have included single-page and paginated examples below.
 * Here is an example for a standard cloud that displays a single-page gallery when
   a term is clicked:
 *     ```
       [mla_tag_cloud taxonomy=category number=0 mla_link_href="{+page_url+}?term_slug={+slug+}"]
   
       [mla_gallery category_name="{+request:term_slug+}"]
       ```
   
 * The interesting part of this example is `mla_link_href="{+page_url+}?term_slug
   ={+slug+}"`. That parameter makes the link assigned to each term go back to the
   current page, adding a `term_slug` argument to the URL. The `term_slug` is used
   to filter the `[mla_gallery]` display.
 * To display a “grid” instead of a cloud, add a few parameters:
 *     ```
       [mla_tag_cloud mla_output=grid smallest=10 largest=10 columns=5 taxonomy=category number=0 mla_link_href="{+page_url+}?term_slug={+slug+}"]
   
       [mla_gallery category_name="{+request:term_slug+}"]
       ```
   
 * To paginate the gallery, add `posts_per_page` and previous/next controls below
   the display:
 *     ```
       [mla_tag_cloud mla_output=grid smallest=10 largest=10 columns=5 taxonomy=category number=0 mla_link_href="{+page_url+}?term_slug={+slug+}"]
   
       [mla_gallery category_name="{+request:term_slug+}" posts_per_page=2 ]
   
       <div style="clear: both; float: left">
       [mla_gallery category_name="{+request:term_slug+}" posts_per_page=2 mla_output="previous_page,first" mla_link_text='&larr;' mla_rollover_text="Previous/first page"]
       </div>
       <div style="float: right">
        [mla_gallery category_name="{+request:term_slug+}" posts_per_page=2 mla_output="next_page,last" mla_link_text='&rarr;' mla_rollover_text="Next/last page"]
       </div>
       ```
   
 * I hope that gets you started on composing the clouds and galleries you need. 
   I will leave this topic unresolved until I decide what to do about thumbnail 
   images. In the interim, please update it if you have any problems or further 
   questions about the examples I’ve given. Thanks again for your interest in the
   plugin.
 *  Thread Starter [sassyfrass475](https://wordpress.org/support/users/sassyfrass475/)
 * (@sassyfrass475)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/simple-shortcodes/#post-5038676)
 * Oooh, snap! You just upgraded my website. 🙂
 * All three codes you gave worked PERFECTLY. Actually, better than I even imagined.
   That’s great that the tags can be displayed in a grid fashion. And that if you
   click on one, it stays on the page and displays the thumbnails in that tag. Aaaand
   there’s pagination options.
 * Thank you, thank you, thank you! This is absolutely awesome!
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/simple-shortcodes/#post-5038677)
 * I am very happy to hear you are making progress; thanks for the good news.
 * I am marking this topic resolved, but please update it if you have any problems
   or further questions on the topic.

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

The topic ‘Simple Shortcodes’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/simple-shortcodes/#post-5038677)
 * Status: resolved