Powerful Content

What are Shortcodes

[shortcode]

[shortcode option=”choice”]

[shortcode] content to be made awesome [/shortcode]

Core Shortcodes

Changing the Default Embed Size with a Shortcode

Code

Remove Extra Spaces:
[ embed width=”240″ ]http://www.youtube.com/watch?v=9YnnKO-2Yko[ /embed ]

Result

A Nice Gallery with a Shortcode

This examples use the default WordPress [ gallery ] short code (remove the spaces around the brackets in all the examples) augmented by the Cleaner Gallery plugin by Justin Tadlock. The “Lightbox” script  is from the Cleaner Gallery plugin.

Code

Remove Extra Spaces:
[ gallery ]

Clean Gallery Settings: Automatically load Thickbox CSS & JS. Link Gallery thumbs to “Large” image files.

Result

Cursory Examples of Other Shortcodes From Plugins

Jetpack Contact Form

Code

[contact-form]
[contact-field label="Name" type="name" required="true" /]
[contact-field label="Email" type="email" required="true" /]
[contact-field label="Website" type="url" /]
[contact-field label="Comment" type="textarea" required="true" /]
[/contact-form]

Result

Mark’s Custom Box Shortcode

[box]Really sweet content in a box. Would you eat eggs in this box? With a fox?[/box]
Really sweet content in a box. Would you eat eggs in this box? With a fox?

Google Maps Shortcode

Update: This plugin is no longer being supported!

Plugin: Comprehensive Google Map Plugin

Code

[google-map-v3 width=”100%” height=”400″ zoom=”14″ maptype=”roadmap” mapalign=”center” directionhint=”true” language=”default” poweredby=”false” maptypecontrol=”false” pancontrol=”true” zoomcontrol=”true” scalecontrol=”true” streetviewcontrol=”true” scrollwheelcontrol=”false” draggable=”true” tiltfourtyfive=”false” addmarkermashupbubble=”false” addmarkermashupbubble=”false” addmarkerlist=”Seattle Art Museum, Downtown Seattle, WA{}computers.png{}Mark and Christine are giving an amazing presentation right here.” bubbleautopan=”true” showbike=”false” showtraffic=”false” showpanoramio=”false”]

Result

[google-map-v3 width=”100%” height=”400″ zoom=”14″ maptype=”roadmap” mapalign=”center” directionhint=”true” language=”default” poweredby=”false” maptypecontrol=”false” pancontrol=”true” zoomcontrol=”true” scalecontrol=”true” streetviewcontrol=”true” scrollwheelcontrol=”false” draggable=”true” tiltfourtyfive=”false” addmarkermashupbubble=”false” addmarkermashupbubble=”false” addmarkerlist=”Seattle Art Museum, Downtown Seattle, WA{}computers.png{}Mark and Christine are giving an amazing presentation right here.” bubbleautopan=”true” showbike=”false” showtraffic=”false” showpanoramio=”false”]