Navigate to a slide with the url

With this code, you will be able to go to a page, where is a slider, and make that slider go to a specific slide depending on the link.

Using PHP

Put this code into your theme right before the </head>:

<?php
if(isset($_GET['slide'])){
    $slide = $_GET['slide'];
} else {
    $slide = 0;
}
?>
<script type="text/javascript">
window['ss2'] = <?php echo $slide; ?>;
</script>

The number in the 'ss2' is your slider's id.

After this you can make the slider to go to a specific slide, if you put a ?slide=1, or other number into the end of your link. This code will get out this number, and when your page loads, the slider will switch to that slide. For example if your slider is here: http://example.com/home/, then with this link, you can make it go to the 2nd slide: http://example.com/home/?slide=1

Using JavaScript only

Put this code into your theme before the </head>, or before the slider:

<script type="text/javascript">
jQuery(document).ready(function(){
    function getUrlVars() {
        var vars = {};
        var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
            vars[key] = value;
        });
        return vars;
    }
    var go_to_slide_number = getUrlVars()["slide"];
    if (typeof go_to_slide_number !== 'undefined') {
        var sliderid = 6;
        window['ss'+sliderid] = parseInt(go_to_slide_number);
    }
});
</script>

Then modify the sliderid variable to your slider's id.

After this you can make the slider to go to a specific slide, if you put a ?slide=1, or other number into the end of your link. This code will get out this number, and when your page loads, the slider will switch to that slide. For example if your slider is here: http://example.com/home/, then with this link, you can make it go to the 2nd slide: http://example.com/home/?slide=1