WordPress - Put the slider's code into a php file

Here is the documentation on how you can find a specific codepart of your website.
1
Go in your admin site to AppearanceEditor, select your theme, then click on the header.php.
2

Find

</header>
	

in your code, there is probably a

<div id="main"class="site-main">
	

or some main id and class div after it

3

Put your shortcode after this

</header>
	

before the other div that follows. The shortcode should look like this, with your sliders id:

<?php echo do_shortcode('[smartslider2 slider="1"]');?>
	

In here the id is 1.

4

Save it, and now you should see it on your frontend.

If you want to put it elsewhere, then you have to find that place in your php files, and put it there.

Also if you want it to only be on your homepage, this is your code:

<?php
    if(is_home()|| is_front_page()){
        echo do_shortcode('[smartslider2 slider="1"]');
    }
?>
	

and on other pages you could do it with checking the page title:

<?php
    if(get_the_title()=="Slider Test Page"){
        echo do_shortcode('[smartslider2 slider="1"]');
    }
?>
	

or better if you know your page’s id, which usually you can see in the link of that page, then you could check the id instead of the page title, and then the slider would stay on that page even if you change the title:

<?php        
if(get_the_ID()==2){

    echo do_shortcode('[smartslider2 slider="1"]');
    }
?>