I’ve written about shortcodes before — and I love them!
You may have run into shortcodes before as many themes and plugins use shortcodes specific to their product to add theme and plugin functionality to your site.
If you are new to WordPress you may be asking….
What is a Shortcode?
The above box is created with a shortcode!
When you are creating a post and upload a bunch of photos for a gallery that you want to display on that post, you can then just use the shortcode. WordPress knows what files you’ve uploaded and “attached” to that post and will take it from there!
Shortcodes Included with WordPress
These are the shortcodes included with WordPress, what they do and how you can add attributes to customize further:
Allows you to embed audio files and play them back. You can loop (keep replaying) the audio and designate autoplay or not. Example attribute to play a file that wasn’t uploaded to that particular post: [audio src=”audio-source.mp3″] Click here for more.
Allows you to wrap captions around content. Generally used for one image. When you insert an image into a post and fill in the caption field you’ll see this shortcode. You can designate width and alignment with attributes. [caption id=”attachment_6″ align=”alignright” width=”300″]Caption Here[/caption] Caption shortcode has a closing tags so that WordPress knows that the caption to display is what is between the opening and closing tag. Click here for more.
Can be used to embed videos, images, tweets, audio into your WordPress site. This is primarily used for YouTube videos. Attributes allow you to designate the size of video: [embed width=”123″ height=”456″]http://www.youtube.com/watch?XXXXXXXXXXX[/embed] Click here for more.
Creates a simple gallery. Example attribute: [gallery id=”123″ size=”medium”] or to include multiple galleries: [gallery ids=”729,732,731,720″]. Click here for more.
The playlist shortcode implements the functionality of displaying a collection of WordPress audio or video files in a post. You can use attributes to order, style and even show or hide the artist’s name. Click here for more.
Allows you to embed video files and play them back. Works pretty much the same as the [audio] shortcode. Click here for more.
By adding the above shortcodes into your posts you can have the accompanying data display. Cool huh?
Even More Stylized and Useful Shortcodes!
One of my favorite theme shops Elegant Themes, home of the shortcode plugin that I use on throughout this very site. That yellow box at the top of this article is using the ET Info Box shortcode.
With the ET plugin you can shortcode buttons and colors, boxes, tabs, sliders, tooltips and much more!
Being most folks use WordPress because it takes the need to “know code” off the table, you also have the option to add even more functionality and visuals by using shortcodes. I know you’ll love them too!
At your service,