Sillybean
Shortcodes
WordPress allows developers to define shortcodes—bracketed words that are replaced with content when the post is displayed to visitors. Shortcodes work like text macros in Microsoft Word. WordPress itself uses shortcodes to insert some forms of media (photos with captions, image galleries). A typical image caption shortcode is shown in Figure 4-5, and the resulting image display (in the Twenty Ten theme) is shown in Figure 4-6.
You might install plugins that provide more shortcodes. For example, if you have pieces of content that you’d like to write once and reuse throughout your site, you could define your own shortcodes using a plugin like Post Snippets (Figure 4-7) or Reusables.

Figure 4-7. Post Snippets lets you define new shortcodes. It gives you the option to place corresponding buttons on the editors’ toolbars.
To create a snippet, enter the shortcode you’d like to use into the Title field, as shown in Figure 4-7. Then enter the expanded version in the Snippet field. You’ll see the shortcode while editing the post, as shown in Figure 4-8, but when a visitor views the post, she’ll see the expanded version, as shown in Figure 4-9.
Sharing this post? The short URL is: http://sillybean.net/?p=5309







