How To Series: rtMedia Shortcodes (Part 1/2)

This How To will introduce you to a handy feature of rtMedia- the shortcode.

Don’t let the name scare you, shortcodes have nothing to do with coding. In fact, they let you do some really cool stuff without writing a single line of code.

A brief introduction to shortcodes

Shortcodes are special commands that you can add into a page or post that tell WordPress to do a certain task for you. All shortcodes can be added into the text editor in the WordPress backend alongside other content.

All shortcodes are written between a set of square brackets, so that WordPress can tell them apart from other content (like you blog post). Don’t worry though, not all text written between square brackets is or should be a shortcode- WordPress will smartly identify only registered shortcodes and leave the rest of your content alone.

<screenshot / example>

rtMedia shortcodes

rtMedia has two shortcodes, whose functions compliment each other.

rtMedia Uploader shortcode

rtMedia allows your users to upload media from several places across your website<link, including from the BuddyPress Activity Feed, Profile page & Comment fields. What if you want to enable uploads from other locations such as from a blog post or dedicated page?

This would be a prime usage example of the rtMedia Uploader shortcode. All you need to do in this case is add the shortocde to the page/post and voila, the rtMedia Anywhere Uploader is at your service:

rtMedia Gallery shortcode

The rtMedia Gallery shortcode compliments the Uploader shortcode- it provides a way to display a gallery of pre-uploaded media. You can control which media gets displayed in the gallery by using a set of conditions, called “parameters”.

A Gallery shortcode with a few parameters looks something like:

[rtmedia_gallery global="true" media_type="photo"]

The initial “rtmedia_gallery” part tells WordPress that you want to display a gallery of media, while the second specifies that you want to display all the photos “media_type="photo"” uploaded by users across your site “global="true"

rtmedia_gallery can currently accept several parameters (or conditions) at once to narrow down the media displayed in the gallery or control the way that they are displayed.

We’ll learn more about how you can use these parameters to display only the media that you want to in our next article.

In summary

Shortcodes are a nifty WordPress feature. rtMedia has two shortcodes- the Uploader & Gallery shortcode- that compliment each other.

As the administrator (or owner) of a rtMedia-powered website, you can customize what each of the shortcodes do via parameters.

That’s it! I hope that this article has provided you with a glimpse into the power of rtMedia shortcodes. Do let us know if you have any questions in the comments below. Have great weekend!

Links: rtMedia Shortcode Demo | Shortcode documentation