Popular Shortcodes
If you are copying and pasting any of the code below, make sure you delete the extra space after the first bracket. You also may want to check out the glossary below.
Foldaway
This shortcode allows you to hide content inside of a container folded away from visibility. Additionally, you are able to use any of the header (H1, H2, H3, H4, H5, H6) elements to style the title of the section.
[ foldaway heading="The Section Title" level="4"] Add your content to be folded away in this space between the brackets. [/foldaway]
Attributes for foldaway
style – changes the default yellow background to transparent.
[ foldaway heading="The Section Title" level="4" style="transparent"] Add your content to be folded away in this space between the brackets. [/foldaway]
+Example with default yellow
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas quis nisi vitae leo pellentesque efficitur. Duis lobortis sit amet justo eget aliquet. Sed quis quam commodo, auctor libero eget, fringilla mi. Morbi dignissim massa tempus, venenatis libero sed, molestie nulla. In hac habitasse platea dictumst. Nullam tristique diam at eros blandit condimentum. Proin ultricies id tellus id vulputate. Etiam lacus quam, dapibus ut nisl quis, egestas egestas lacus. Mauris sed velit ex. Vestibulum ultricies mauris a iaculis vestibulum. Duis et tempor felis, id efficitur justo. Maecenas sodales dignissim laoreet.
+Example with transparent background
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas quis nisi vitae leo pellentesque efficitur. Duis lobortis sit amet justo eget aliquet. Sed quis quam commodo, auctor libero eget, fringilla mi. Morbi dignissim massa tempus, venenatis libero sed, molestie nulla. In hac habitasse platea dictumst. Nullam tristique diam at eros blandit condimentum. Proin ultricies id tellus id vulputate. Etiam lacus quam, dapibus ut nisl quis, egestas egestas lacus. Mauris sed velit ex. Vestibulum ultricies mauris a iaculis vestibulum. Duis et tempor felis, id efficitur justo. Maecenas sodales dignissim laoreet.
Collapsible Areas
This shortcode gives you a clickable title bar with a section of content that slides out below. You can also link directly to the opened bar. To get that link, click the bar first and then copy the url from your browser address bar.
- ttl – displays the title in the colored bar.
- start – (optional) set this to “open” to make this section opened initially upon page load.
- color – (optional) allows for the customization of the background color of the bar. Accepts any html color value. For example, if you wanted the title bar of the collapsible area to be Garnet, use: color=”#851326″ within the first bracket after the title.
[ btn ttl="The Title Bar"]Lorem ipsum...[/btn]
You can create a link to open every collapsible area on the page by giving it the id “open-all-btns” like <a href=”#” id=”open-all-btns”>Click<a>
The Title Bar
Highlight Boxes
Highlight/callout content by putting a box around.
Attributes
- color – (optional) choose what color the box should be. By default it’s yellow, but you can also choose pink, green, and blue.
[ highlight]Example one[/highlight]
[ highlight color="green"]Another example, this one green![/highlight]
Example one Another example, this one green!
Call to Action Button
An inviting clickable button. This has a lot of options, but only the link is required.
Attributes
link – the url to send the user to.
type – (optional) Specify a type of button to display. Options are “full-button” and/or “large-button.
target – (optional) Whether the link should open in a new page. To make the link open a new page, use target=”blank”.
style – Specify a varity of colors and arrows for the button. Options are: gray-button, blue-button, aqua-button, dark-button, white-button, with-arrow.
[ cta link="https://www.bates.edu"]Default Button[/cta]
[ cta link="https://www.bates.edu" type="large-button"]Large Button[/cta]
[ cta link="https://www.bates.edu" type="full-button"]Full Width Button[/cta]
[ cta link="https://www.bates.edu" type="large-button full-button"]Large and Full Width Button[/cta]
[ cta link="https://www.bates.edu" style="gray-button"]Gray Button[/cta]
[ cta link="https://www.bates.edu" style="blue-button"]Blue Button[/cta]
[ cta link="https://www.bates.edu" style="aqua-button"]Aqua Button[/cta]
[ cta link="https://www.bates.edu" style="dark-button"]Dark Button[/cta]
[ cta link="https://www.bates.edu" style="white-button"]White Button[/cta]
[ cta link="https://www.bates.edu" style="with-arrow"]Button with arrow[/cta]
[ cta link="https://www.bates.edu" style="blue-button with-arrow"]Blue Button with arrow[/cta]
Gallery
This is an enhancement of the normal WordPress gallery. In order to use these, first create a gallery using the standard WordPress methods, then add these attributes to the generated shortcode (the gallery shortcode will only be visible in the text tab of your page editor.
Attributes
- Tiled gallery: To disable the slideshow and display a regular WordPress tiled gallery, use slideshow=”false” in the shortcode.
- Transition effects: To use a left/right scrolling effect, use effect=”scroll” (defaults to a fade effect).
- Bookmarkable slides/images: Give the ability to link to an individual slide by adding bookmarks=”true”.
- Disable captions: Turn off captions with captions=”false”.
- Add Thumbnails: Add clickable thumbnails to the bottom of the gallery with thumbnails=”true”.
- You can change the size of the thumbnails with thumbnailsize=”x” (where x is a css unit size). Defaults to 100px.
- Autoplay: Turn on autoplay with autoplay=”true”.
- Transition Length: When using an autoplay gallery, you can change how long the transitions last with effectlength=”x” (where x is the number of seconds it should take to change slides) (defaults to .5 second).
- Slide Length: When using autoplay, change the length each slide is displayed with autospeed=”x” (where x is the number of seconds each slide is displayed before moving to the next). Defaults to 4 seconds.
- Disable controls: Hide the controls with controls=”false”. This, of course, only makes sense for autoplay slideshows.
Show Children Pages
Prints a list of the children pages of the current page.
Attributes
- order – Desc or Asc
- orderby – title, modified, date, or author. Defaults to title.
- childdepth – To what depth should children of children show? Defaults to 1, meaning first level of children only.
[ list-children]
Display information about someone at Bates
Staff
Attributes
id – A Bates username.
[ batesperson id="jburns"]
Burns, H. Jay, Jr.
Senior Editorial Director & Editor of Bates Magazine
Bates Communications and Marketing Office
207-786-6331
Lane Hall, Room 025H
Faculty
[ faculty-profile for="erand"]
Erica Rand
Professor of Art and Visual Culture and Gender and Sexuality Studies
Associations
Art and Visual Culture
Pettengill Hall, Room 215
Gender and Sexuality Studies
Pettengill Hall, Room 215
Show a post’s content in another post
This shortcode grabs the content from any other page on any other site within the Bates network and displays it as if it had been written directly on the current page.
Attributes
id – The id of the post to grab content from
blog – (optional) The name of another site in the network to look for the page/post id within.
[ purloin_content id="32295" blog="news"]
The Jimmy Bruno Trio, led by jazz guitarist Jimmy Bruno, will perform at 8 p.m. Sept 13, in the Olin Arts Center Concert Hall, 75 Russell St. General admission at the door is $10 and $5 for students and seniors. For reservations call 207-786-6135.
Bruno, first influenced by his father’s guitar work on Frank Virtue and the Virtue’s 1959 hit “Guitar Boogie Shuffle,” toured with Buddy Rich at age 19 before doing studio work and recording with Tommy Tedesco in Los Angeles. His releases on Concord Records include Burnin’, Slight of Hand, Like That and Live at Birdland. He also appeared on The Concord Jazz Guitar Collective with Alden and Frank Vignola.
Joining Bruno for the Bates concert will be his regular Philadelphia- based rhythm section: drummer Vince Ector and bassist Craig Thomas.
You can also use this shortcode in an advanced way. Using the advanced placeholders @title@, @author, and @content allows you to use the original post’s author and title, as well as have more control over where the content displays.
For example:
[ purloin_content id="51141" blog="news"]The original article was written by @author@ and was named @title@. You can read it in it's entirity here. @content@ [/purloin_content]
A Brown University physics professor discusses the use of magnetism to alter cellular processes, such as cell division and swimming behavior, in a Bates College lecture at 2:40 p.m. Friday, Dec. 2, in Carnegie 204, 44 Campus Ave.
Sponsored by the Bates physics department, the event is open to the public and refreshments will be served.
James Valles’ talk is titled “Manipulating Life with Intense Magnetic Fields.” He will explain that while living cells tend not to be much affected by terrestrial magnetism, magnetic fields that are sufficiently intense can align certain cellular components.
Valles will describe his research into the effects of strong magnetism on such organisms as frog eggs, whose cell division is altered by its influence, and the paramecium, a single-celled organism whose swimming behavior is affected by magnetism.
Valles has taught at Brown since 1992. He received an Alfred P. Sloan Foundation Fellowship, awarded to early-career scientists with outstanding promise and unique potential to make substantial contributions to their field. Valles received his doctorate from the University of Massachusetts and his bachelor’s degree from Dartmouth College, both in physics.
Glossary
Attribute
Part of the shortcode which specifies that a certain name equals a certain value.
name="value"
This is always found inside the first part of the shortcode, between the brackets.
Opening/Closing Tag
Some shortcodes have a single element like
[example]
and some have a start and ending element like
[example] content [/example]
The first element, the [example], is the opening tag, and the second one, the [/example] is the closing tag. Note the closing tag has a /.
Content Area
In shortcodes with both an opening and closing tag, the space between the tags is the content area. Highlighted below:
[example name="value"] This is the content area. [/example]