When
writing posts, don't you feel a bit tired because you had to repeat a lot of information? For example, a styled <div>
element to display a downloadable file, or some information about the author?
When you know that you'll have to insert the same code snippets on many posts, you should definitely create a shortcode.
Introduced in WordPress 2.5, the shortcode APIs are a simple set of functions for creating macro codes for use in post content. A classic shortcode looks like this:
[author_info]
Shortcodes can handle attributes. For example:
[download file="myfile.zip"]
Also, a shortcode can have embedded content:
[mycode]Some Content[/mycode]