Publish on WordPress

Available publishing methods

Shortcode

You can copy/paste the shortcode of your slider into your pages and posts, or just use the Smart Slider button in them, select your slider's name, and it will paste the shortcode there by itself.

Gutenberg

The Gutenberg publishing method is available since version 3.3.7.

1
Adding a new block

You can publish the slider by creating a new Smart Slider 3 block.

2
Creating from paragrapgh

You can also publish the slider by creating a new paragraph and selecting Add Smart Slider 3.

Widget

You can also select our slider in the WordPress' Appearance → Widgets. If you don't have a good widget position, check out the PHP code publishing or this documentation.

Widgets are usually showing up on more pages, so in case you would only want your slider to show up on certain pages, use a plugin, which allows you to select where widgets should show up, like this one.

PHP code

For this publishing method you will need PHP and HTML knowledge.

If you are not sure about yourself, always have a backup, and edit from your FTP, not from the Appearance → Edit, because you can make php errors there, big enough to make your whole website blank including your back-end.

WordPress offers a do_shortcode function, what you can use to put shortcodes into your theme's php files.

  • You will need to find the codepart, where you want to have your slider. You can find a documentation on how to do that here. Also this video could help.
  • After you have got the code, use the do_shortcode function to put your slider there. You can also use some other WordPress functions to make your slider only show up on certain pages.

If you modify your theme and then update it later, all modifications will be lost.

If you would like to keep updating your theme, and don't want to reinsert our PHP code every time you do that, then you could create a child theme!

Useful PHP functions

1
Show up everywhere:
<?php echo do_shortcode('[smartslider3 slider=1]'); ?>
	
2
Only on the homepage:
<?php
  if(is_home() || is_front_page()){
      echo do_shortcode('[smartslider3 slider=1]');
  }
?>
	
3
Only on that page which has 2 as its ID:
<?php
  if(get_the_ID()==2) {
      echo do_shortcode('[smartslider3 slider=1]');
  }
?>
	
4
Only on that page which has "Slider Test Page" as title:
<?php
  if(get_the_title()=="Slider Test Page") {
      echo do_shortcode('[smartslider3 slider=1]');
  }
?>
	
5
Mix them:
<?php
  if(is_home() || is_front_page() || get_the_ID()==2 || get_the_title()=="Slider Test Page") {
      echo do_shortcode('[smartslider3 slider=1]');
  }
?>
	
Do you need a little bit more dynamic way to show your sliders from your posts?  Create a new widget position instead, or use  Advanced Custom Fields plugin mixed with your code.

Advanced shortcode usage

In the examples you will see the 71 number as the slider's ID, but you have to get yours from your slider's shortcode.

1
Start from a given slide

Example: start from 2nd slide

[smartslider3 slider=71 slide=2]
	
2
Start from a variable given in the URL
This only works, if you are not using cache on your website! If you are using cache, then use our  JavaScript only code.

You can put variables into urls, for example: http://example.com/index.php?slide=5

You could use that variable to decide which slide to load first:

[smartslider3 slider=71 get=slide]
	
3
Only show the slider on the homepage
[smartslider3 slider=71 page=home]
	
4
Only show the slider on the page with the given ID

When you are in your post or page editor, you can read out the ID of the currently edited post/page from the url. For example:

http://example.com/wp-admin/post.php?post=2010&action=edit

In this case the page ID is 2010, and with this shortcode my slider will only show up there:

[smartslider3 slider=71 page=2010]
	
5
Only show the slider for logged in users
[smartslider3 slider=71 logged_in=1]
	
6
Only show the slider for logged out users
[smartslider3 slider=71 logged_in=0]
	
7
Only show the slider for the given user role
[smartslider3 slider=71 role=subscriber]
	

If you are not sure about the exact user role identifier on your website, use a plugin like  User Role Editor and check out the identifiers in it.

8

Only show the slider for users having the given capability

[smartslider3 slider=71 cap=edit_posts]
	

WordPress has some default capabilities what you can see  here, but you can use User Role Editor to identify all the available capabilities.

9

Only show the slider on a given language 3.3.12

[smartslider3 slider=71 lang=en_US]
	

WordPress has a  get_locale function, which returns the language of the currently viewed page. Language plugins should be compatible with this function, so this language identification should work. It is possible, that the languages will be stored similarly as you see it on this list (example: en_US, hu_HU), but if that wouldn't work, try their lowercase versions (example: en_us, hu_hu) or only use the shorter version (en, hu). If you are a developer, this PHP code could tell you the exact value you are looking for:

var_dump(get_locale());
	
10

Force the slider to load inside an iframe 3.3.12

[smartslider3 slider=71 iframe="some reason"]
	

You can force our slider to load inside an iframe, so it wouldn't be affected by any codes coming from your website. This can be a solution for  autop problemstoo strong CSS codes coming from the theme or custom codes, etc.. The "some reason" can be anything, so you could even write the same "some reason" text. Please note, that if you have one slider loading with iframe, on that page all sliders following it will be loading inside iframes.