If you have a WordPress website, you may have run into something called ‘shortcode’. What this is, is a quick short cut tool to embed files or objects onto a page or post that would otherwise require long, complicated coding. Many plug-ins utilize shortcode to embed the plug-in onto a page as well. Shortcodes use PHP to pull in existing coding from other sources such as plug-ins or theme functions so that the publisher of the post or page can easily insert files or format their post without the need for programming skills.
A basic shortcode looks like this:
A shortcode with attributes looks like this:
Attributes are parameters that allow you to be more specific about what gallery you would like to display and how you would like it displayed.
What can I do with Shortcode?
WordPress has various shortcodes built in for embedding different kinds of video, images, audio, documents, as well as contact forms, polls, lists, maps, and calendars. It also allows you to do basic formatting such as columns and lists. They work in combination with outside coding located in the plug-in or theme that allow you to set up the coding for the file or object externally and the shortcode pulls it directly onto your page. By using attributes you can set parameters for your shortcode to customize it’s functionality and appearance. Advanced users can even set up their own shortcodes by coding them into their websites using PHP. You can view the WordPress.com for more information on standard shortcodes that are available. You can also check the documentation of the Theme you’re using to see if there are any shortcodes available specific to that theme.
Default WordPress Shortcodes: