Spring Sale: Our new update is live! Save 30% on Pro and Pro Unlimited for a limited time.

Use Shortcodes

In this article, we're going to explain the WordPress shortcodes included with X and Pro.

  1. What is a Shortcode
  2. Global Blocks as a Shortcode
  3. Legacy Shortcodes
  4. Summary

What is a Shortcode

Shortcodes in WordPress are little bits of code that allow you to do various things with little effort. They were introduced in WordPress 2.5, and the reason to introduce them was to allow people to execute code inside WordPress posts, pages, and widgets without writing any code directly. This allows you to embed files or create objects that would normally require a lot of code in just one single line. Click here to learn more about the standard WordPress shortcodes.

The X and Pro themes and the standalone Cornerstone plugin used the WordPress shortcode system as the base of the elements that you could add to the page in the old versions. All the elements that you see in the builder which have the classic label use the shortcode system at the end of the day.

The V2 elements which do not have any prefix in the builder, store the information directly to the database and do not have any shortcode representative. But there is a new feature available called the Global Blocks which can help you generate a shortcode using the V2 elements that we will discuss in the next section.

Global Blocks as a Shortcode

Global Blocks provides the same GUI of the builder to add different V2 or classic elements. The end result of the global block is a shortcode which you can use to add to different parts of the WordPress. Alternatively, you can use the Global Block element in content, header and footer builders instead of pasting the direct shortcode.

Now, we are going to briefly discuss each legacy shortcode and link to proper demo pages to see each shortcode result live. Just remember that you do not need to use the following shortcodes directly as the X, Pro, and the standalone Cornerstone builder already have a classic element which does the same job.

Legacy Shortcodes

Time for a quick history lesson! In the early days of X (until version 3), all of our page building elements were powered by shortcodes. These could be handwritten to create pages, or Visual Composer could be used to arrange them. This was improved with the release of Cornerstone and X version 4 where we provided our own builder with Elements that were powered by the same shortcodes under the hood. Soon after Pro was released, and Cornerstone 2.0, we are now using a new Element system that doesn't require shortcodes. These elements are much more powerful and can be fully styled.

While it is still possible to use these shortcodes, and they will always be supported, it is no longer something we recommend doing for new sites.

Summary

We talked about the shortcodes in the WordPress and the Global Blocks feature which can be used as shortcodes in X, Pro and standalone Cornerstone plugin, and we also covered the legacy shortcodes.

See something inaccurate? Let us know