Shortcodes

A Shortcode is a WordPress-specific code that is used in post/page content or the section widget to execute a piece of dynamic code.

For example, assume the shortcode [year] will display the current year. How can this be useful? Well, if you ever write, "In 2010 things will be different" and want 2010 to automatically correspond to the current year, you can just write "In [year] things will be differrent" and the year will automatically correspond to the current year.

In other words, a shortcode is a WordPress-specific code that lets you do nifty things with very little effort.

PLEASE NOTE: Shortcode attributes, for example, an attribute would be the title in the accrodion shortcode [accordion title="Accordion Title"], should not contain any html tags, for example: strong tags, header tags, page breaks. The effect could cause issues with the websites layout or functionality.

source: http://wiki.ubc.ca/Documentation:UBC_Content_Management_System/What_is_a_shortcode
Did you find this content useful?
57 Yes

Leave a Reply

You must be logged in to post a comment.