Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author simonpedge

    (@simonpedge)

    Yes, I did implement URL hash navigation previously, but a lot of people complained because this functionality modifies the URL of the page, adding a hash (named anchor) address the end of the url depending on the slide being viewed – e.g
    https://owlcarousel2.github.io/OwlCarousel2/demos/urlhashnav.html#one
    https://owlcarousel2.github.io/OwlCarousel2/demos/urlhashnav.html#two

    So I hastily removed this functionality. It is something I will be revisiting in the future – adding a checkbox option to switch this function on and off.

    If you wanted to add this function manually, you can edit the file:
    /wp-content/plugins/slide-anything/php/slide-anything-front.php
    On line 493, you will see the line:
    //$output .= " URLhashListener : true,\n";
    Remove the comments, so the line becomes:
    $output .= " URLhashListener : true,\n";

    Thread Starter helenelo

    (@helenelo)

    Hello,
    Thanks for the answer. I don’t know why, it doesn’t seem to work. I found the line, the file was /wp-content/plugins/slide-anything/php/slide-anything-front-end.php and not front.php. Maybe this is the pb?

    This is the website by the way : http://livre.selfrance.org/expo

    Thanks,
    Hélène

    Plugin Author simonpedge

    (@simonpedge)

    Yes, slide-anything-frontend.php is the correct file.

    Having a look at the file again, I see you need to make some more changes on lines 345 to 347:

    //$data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
    //$output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
    $output .= "<div class='sa_hover_container' style='".esc_attr($slide_style)."'>";

    Remove the comments from 2 lines and comment out the 3rd line so this becomes:

    $data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
    $output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
    //$output .= "<div class='sa_hover_container' style='".esc_attr($slide_style)."'>";
    Thread Starter helenelo

    (@helenelo)

    Hi,
    Thank you very much. The work is almost done i think 🙂
    The #link appears actually in the adress, but when i try to link a button to one specific slide, it still shows the first one..

    Page with the button : http://livre.selfrance.org/sample-page
    Page with the slider : http://livre.selfrance.org/expo

    Thanks,
    Hélène

    Plugin Author simonpedge

    (@simonpedge)

    Try inserting the following line after line 493:
    $output .= " startPosition : 'URLHash',\n";

    So you will have

    $output .= "			URLhashListener : true,\n";
    $output .= "			startPosition : 'URLHash',\n";
    $output .= "			mouseDrag : ".esc_attr($slide_data['mouse_drag']).",\n";
    Thread Starter helenelo

    (@helenelo)

    Works perfectly ! Thank you so much. You’re plugin is just amazing !

    • This reply was modified 8 years, 9 months ago by helenelo.
    Plugin Author simonpedge

    (@simonpedge)

    I’m glad you managed to get it working 😉

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Url Hash Navigation with slides’ is closed to new replies.