Welcome to our new Help Center. We’re still adding articles, and if you can’t find an answer yet, we’re happy to help.Contact Us

Add a project with a shortcode

A project’s shortcode is copied in the LayerSlider dashboard and pasted where the project is to appear: in a page, a post, a widget area, or a page builder.

On this page

    Add the shortcode to a page

    A project’s shortcode is a piece of text in square brackets that WordPress replaces with the project when it shows the page.

    1. In the LayerSlider dashboard, move the pointer over the project’s card and click the ⋮ icon that appears in its top right corner.

      The card’s menu opens.

    2. Choose Embed.

      The Embed Projects window opens on its Shortcode tab.

    3. Click Copy to Clipboard.

    4. In your WordPress admin, open the page for editing.

    5. Paste the shortcode where the project is to appear.

      In a page builder, a plugin for designing pages visually, paste it into a text or shortcode element.

    6. Save the page: click Publish on a new page, or Save or Update on a published one.

    7. Open the page in a new tab.

      The page shows the project as you last published it in the Project Editor, so changes you’ve only saved show on the page after you publish them.

    In the Project Editor, the same window opens from How to Embed in the ⋮ menu of the toolbar.

    In the block editor, and in page builders that have a LayerSlider element of their own, you can use that element instead.

    Choose the project by ID or slug

    The shortcode’s id is the project’s ID or slug, and the Embed Projects window gives the slug if the project has one. The ID follows the project’s name on its card in the LayerSlider dashboard, for example #12. The slug is a name of your own, set in Project Settings › Publish › Project Slug & Keywords, and works after you publish the project.

    After an export and import to another site, the project has a new ID there, but a shortcode with its slug works if no project there has that slug.

    Show the project only on some pages

    A shortcode or a LayerSlider widget in a widget area, such as a sidebar, shows its project on every page with that area. To show the project only on some pages, list them in the shortcode’s filters or the widget’s Optional filters: field, using these items:

    • homepage, for the front page
    • A page’s or a post’s ID or slug, for that page or post
    • A category’s slug, for the posts in that category

    Write the items without spaces after the commas: a slug after a space doesn’t match its page.

    A page’s or a post’s slug is the last part of its address, and its ID is the number after post= in the address of its editing screen. A category’s slug is in the Slug column of Posts › Categories.

    These shortcodes show the project on the front page and the page contact, on the front page and page 42, and on posts in news:

    TEXT
    [layerslider id="summer-sale" filters="homepage,contact"]
    [layerslider id="summer-sale" filters="homepage,42"]
    [layerslider id="summer-sale" filters="news"]

    Change summer-sale and the items to your own. In the widget’s field, enter only the list, for example homepage,contact.

    Change the settings for one place

    For another layout or behavior on one page, add an attribute to the shortcode there. The project keeps its own settings everywhere else. These attributes change the layout and the slideshow:

    Attribute What it changes Values
    type The layout, as the tiles of Project Settings › Layout set it fixedsize, responsive, fullwidth, hero, or fullsize, for Fixed Size, Responsive, Full Width, Hero, or Full Size
    autostart Auto-Start Slideshow, in Project Settings › Slideshow 1 to turn it on, 0 to turn it off
    firstslide Start with Slide, in Project Settings › Slideshow The number of the slide to start with

    Write the attributes in lowercase, as here. The value false doesn’t turn a switch off: use 0.

    These shortcodes show the project at full width, without starting its slideshow, and with all three:

    TEXT
    [layerslider id="summer-sale" type="fullwidth"]
    [layerslider id="summer-sale" autostart="0"]
    [layerslider id="summer-sale" type="fullwidth" autostart="0" firstslide="2"]

    If the page shows the shortcode as text

    The shortcode shows as text for one of these reasons:

    • The shortcode is in an element that shows its text as it’s written, such as the block editor’s Code block. Paste it into an element that runs shortcodes: a Shortcode block, a page builder’s shortcode element, or in some editors a plain text element.
    • The shortcode’s name has capitals. Write layerslider in lowercase.
    • LayerSlider isn’t active. While it’s turned off, WordPress doesn’t recognize the shortcode and shows it as it’s written. In your WordPress admin, go to Plugins and click Activate in LayerSlider’s row: the project shows on the page again.