What is a shortcode?
A shortcode is a WordPress shortcut that you can use to format your page without using any complex HTML or CSS.
At the University Library, shortcodes allow regular users to make extensive customizations to pages without the need to contact an IT pro!
The tutorials linked on this page will teach you how to use shortcodes to improve the design of your site.
Shortcode syntax
Shortcodes on our site share a common syntax, that we will present here in pseudocode:
- Begin with an opening square bracket:
[
- End with a closing square bracket:
]
- The first text after the opening square bracket is the name of the code:
[aShortcode]
- Shortcodes can contain attributes and values for those attributes. Attribute values should be in quotation marks:
[aShortcode anAttribute="anAttributeValue"]
- Some shortcodes are paired, placing opening and closing codes around content to be formatted. The closing code will simply be the code name with the prefix ‘end’:
[aShortcode anAttribute="anAttributeValue"]Some Content[endaShortcode]
Why they’re important
In our former content management system (OpenCMS) all users could make extensive formatting changes and add custom scripts to pages. Unfortunately, sometimes these customizations created problems because the expertise needed for maintenance would leave the department. Other times, the customizations would look great, but violate important accessibility rules. Shortcodes allow you to still make significant customizations to your site without worrying about these issues. Shortcodes are compliant with web standards and maintained by the Web Team. Contact the Web Team or your local pro if you need to do something the shortcodes cannot. They can help you with the customization or suggest other solutions.
Shortcode tutorials
- Accordion Pane:
[accpane]
- Box Title [boxtitle]
- Button:
[button]
- Child Pages: [childpages]
- Collapsible panes
[collapse-pane]
- EasySearch & DOI Search: [displayES] | [displayDOI]
- Font Awesome icons:
[fa]
- Image Gallery [image-gallery]
- Latest Feed [rssfeed]
- LibAnswers :
[faq]
- Lists:
[list]
- New Titles Feed: [displayNewTitlesText] OR [displayNewTitles]
- Panes:
[pane]
- Person Info:
[personinfo netid=""]
- Rows and columns:
[row][column]
- Snippets:
[snippet]
- Tooltips:
[tooltip]
- Unit Contacts:
[unit-contacts unit=""]
- Unit Info:
[unit-info unit=""]