It is possible to specify that your MetaSlider slideshow only appears on specific posts, pages, or your homepage.
The restrict_to in shortcode #
You control the display of the shortcode using the “restrict_to” value. The “restrict_to” settings can be any of the following:
- home
- post ID
- post slug
These shortcodes will work inside posts, pages and other areas of your WordPress site. However, they are probably most useful for placing inside your theme’s template files.
Examples of restrict_to in shortcodes #
This shortcode below will take a MetaSlider slideshow with the ID of “30” and display it only on the site’s homepage.
[metaslider id="30" restrict_to="home"]
This next shortcode will take the same slideshow and display it only on a Post or Page with the ID of “50”.
[metaslider id="30" restrict_to="50"]
This next shortcode will take the same slideshow and display it only on a Post or Page with the slug of “welcome-to-wordpress”.
[metaslider id="30" restrict_to="welcome-to-wordpress"]