Short Codes

Short Codes are shortcuts to writing HTML code designed for WordPress. The use of short codes greatly speeds up page creation.

[media]
Creates a complete <media> element. Automatically inserted when you use the "Add Media" button. Attributes:
  • id: the ID for the image in the media library, e.g., id='453'
  • caption: override the caption saved with the image, e.g., caption='Students receive major awards.'
Example: [figure id='564']
[href]
Returns a link based on targets within the site. Keeps internal site links correct despite page organization, domain name changes, etc. Very useful with Markdown. Attributes:
  • id: the ID for the post/page, e.g., id='453'
  • slug: the slug for a post/page, e.g., slug='home'
  • anchor: add an anchor target for a post/page, e.g., id='453' anchor='contact'
  • category: the slug for a category, e.g., category='news'
Example: [Latest News]([href id='453'])
[link_atts]
Creates attributes for an <a> element based on targets within the site. Keeps internal site links correct despite page organization, domain name changes, etc. Attributes:
  • id: the ID for the post/page, e.g., id='453'
  • anchor: add an anchor target for a post/page, e.g., id='453' anchor='contact'
  • category: the slug for a category, e.g., category='news'
Example: <a [link_atts id='453']>Latest News</a>
[recent_posts]
Creates figure elements that link to the most recent posts. Attributes:
  • category: category of posts to be included
  • tag: tag of posts to be included
  • subtitles: display subtitles or not
  • numberposts: number of posts to display
  • exclude_posts: comma-separated list of post IDs to exclude
Example: [recent_posts category='alumni-friends' tag='feature' subtitles='true' numberposts='6' exclude_posts='10700,10705,10715']
[event_list]
Creates a list of events linked to their posts. Attributes:
  • category: category of event posts to be included
  • upcoming: set to 'true' to include only upcoming events in the list
  • number: number of event posts to display
Example: [event_list category='seminar' upcoming='true' number='6']
[include_html]
Includes an HTML Snippet. Attributes:
  • slug: slug of the HTML Snippet to be included
Example: [include_html slug='contact-info']