how to remove the #prettyphoto from the url
Asked Answered
A

2

16

i m using prettyphoto media wordpress plugin(version 3.1.4). its working fine for me but my problem is that when i click on any image and it opened in lightbox then there is some additional tag in url like:#prettyPhoto[landscaping]/0/ thats why the url looks like:www.myssite.com/#prettyPhoto[landscaping]/0/.

how can we remove this extra tag. here is the code in my jquery.prettyPhoto.js file:

function setHashtag(){
        if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
        location.hash = theRel + '/'+rel_index+'/';
    };

    function clearHashtag(){
        if ( location.href.indexOf('#prettyPhoto') !== -1 ) location.hash = "prettyPhoto";
    }
Alanalana answered 22/5, 2013 at 12:59 Comment(1)
if someone is using prettyphoto media wordpress plugin then in plugins customization tab setting part you can uncheck the Allow prettyPhoto to update the url to enable deeplinking. [default: true].it will work.Alanalana
V
48

I had the same problem yesterday, and I'm quite sure I found the answer here in stackoverflow... I visited so many websites, forums... so I don't remember where I got the answer exactly.

Anyway, I'm working on Dreamweaver, but I guess the code is similar in WP.

What you gotta do is specify the deeplinking property as false when you call prettyPhoto.

This is my code:

    $(document).ready(function(){
        $("a[rel^='prettyPhoto']").prettyPhoto({
            theme:'light_rounded',
            social_tools:false,
            deeplinking:false,      
    });
});

I'm a total noob in js, but I hope this helps :)

Vaginate answered 11/6, 2013 at 2:20 Comment(1)
This absolutely helps and this is one way where we can hide the ugly URL and back from any page results in actual uRL rather than a picture popup. This is the correct answerArtamas
F
1
  $(document).ready(function() {
      $("a[rel^='prettyPhoto']").prettyPhoto({
          theme: 'light_rounded',
          social_tools: false,
          deeplinking: false
      });
  });

use deeplinking:false to remove #prettyphoto from url

Fatsoluble answered 9/10, 2017 at 11:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.