Show menu

Skip to content
  • Home|
  • About|
    • Contact|
    • Support this site|
  • Blog|
  • Archives|
    • WordPress|
    • Web Design|
    • Software|
    • Robotics|
    • LEGO|
    • Tutorials|
  • Plugins|
    • Code Snippets|
    • BuddyPress Security Check|
    • Post Formats|
    • Personal Email|
    • Bookmarks Shortcode|
  • Resources|
  • PortableApps|
    • Bricx Command Center Portable|
    • ColorConsole Portable|
    • NeXT Commander Portable|
    • QuickPHP Portable|

Shea Bunge

Google+ GitHub WordPress WordPress Stack Exchange Twitter Subscribe Contact
You are here: Home / Displaying shortcodes in WordPress

Displaying shortcodes in WordPress

Published on 22nd October 2012
Displaying shortcodes in WordPress

We all love shortcodes.

Bits of reusable content that can be easily inserted into a post or page via an easy-to-remember tag. Who doesn’t love ‘em?

For those who don’t know, shortcodes look something like this: [this-is-a-shortcode foo="bar"]. When visitors see the post on your blog, the shortcode is magically transformed into whatever content they are set to hold.

There is a small problem with shortcodes, and that is when trying to publish a post, such as this one, and you want to shoe the reader how to insert shortcodes, such as a shortcode built-in to WordPress, like [gallery], or one created by a plugin, like [column], how do you display the actual shortcode in your post, without it being replaced with its predefined contents?

The secret is called escaping. That means that you want to show code, without it actually executing. You can escape shortcodes by adding an extra set of square brackets around it – like [[gallery]], or [[column]].

I hope that this post has helped you in some way – if so, please tell me so in the comment section below.

Share this:

Like this:

Like Loading...

Possibly Related Posts

  1. Bookmarks Shortcode plugin updated to version 2.0!
  2. Code Snippets plugin released
  3. Best of xkcd for programmers
  4. This post is super-awesome
Posted in Tutorials, WordPress | Tagged shortcodes | Leave a response

Post navigation

← How to hide the WordPress.com Stats smiley face Firefox inside Firefox →

Leave a Reply Cancel reply

About Me

Hi! My name is Shea; I'm a teenage Web developer. I specialise in WordPress and PHP code, and I make lots of cool open-source projects. Read more…

Stack Exchange

Combined Stack Exchange profile for bungeshea

Affiliates

ManageWP Dropbox .htaccess made easy Pippin's Plugins

Follow Blog via RSS

RSS Feed RSS - Posts

RSS Feed RSS - Comments

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 15 other subscribers

Copyright © 2013 Shea Bunge

Proudly powered by WordPress

Follow me on Twitter

My Tweets

Buffer

Be awesome on social media. Easily add great articles, pictures and videos to your Buffer and we automagically share them for you through the day!

Signup to Buffer using the button below and we'll both get awesome extras!

Signup to Buffer

Dropbox

Dropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily. Never email yourself a file again!

Signup to Dropbox using the button below and we'll both get 500 MB of bonus space (on top of the usual 2 GB)!

Signup to Dropbox

RSS The NXT Generation Robotics

  • Paper plane folding and shooting robot
  • LEGO MINDSTORMS EV3
  • Code for RoboCupJunior Rescue now available on GitHub
  • Everything you need to know about the ultrasonic sensor
  • RoboCupJunior Hobart Regional 2012: Round 1

RSS LEGO BrickFORCE

  • LEGO Minifigure Infographic
  • LEGO Star Wars 2013: First pictures finally!
  • LEGO Star Wars 2013: A sneak preview
  • Brixhibition Announced
  • A new look
  • Archives
  • About Me
  • Contact Me
  • Donate
  • Privacy Policy
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
%d bloggers like this: