How to use Shortcodes With Layers Widgets

How To  Tutorials  Last Updated: Time to Read: 1 minute

The Excerpt area of a Content Widget column, or Slider widget slide can accomodate just about any basic HTML or shortcode content. In most cases all you need to do is drop the shortcode into the Excerpt area of the widget and that’s it.

How well the output of the shortcode will work in a Layers page depends on whether the shortcode is introducing scripting or styling that is in conflict with the rest of the page content.

If you need a basic widget for adding HTML and do not need the additional Layers options, use the Text widget. This widget works fine in Layers builder pages, but cannot take shortcodes or Javascript. For that you need to use the Slider or Content Widget. We will be adding a Rich Text Widget in 1.1.6 that solves this.

The Content Widget can accomodate multiple columns and allows you to set colors and alignment separately from the main section background.

The Slider Widget is best if you want to control the height of the section and only need one column. This is preferable to using the Content Widget in 1 column mode. as the Slider widget is easier to customize in terms of the content’s position or width. It also has the benefit of allowing a specific height to be set.

In most cases, you can display shortcodes that need a full width space by using the Content Widget on the 12 of 12 column width.

When using the Slider, the excerpt width is limited to a maximum of 745px to ensure the content remains readable at all screen sizes.

You can reset this, along with the content’s limitations (to allow for content to be centered) with the following electors in the Advanced panel. In this example, we have created a custom class called shortcode-slider