开发者

header.php file generating random string at end of URL in location bar

开发者 https://www.devze.com 2023-04-10 17:24 出处:网络
I\'m developing a heavily redesigned a WordPress theme, including layout, templates and functions and for some reason the header.php file is now generating a random string and appending it to every UR

I'm developing a heavily redesigned a WordPress theme, including layout, templates and functions and for some reason the header.php file is now generating a random string and appending it to every URL on my domain after a hash tag like this:

http://www.pixelsandtea.com/#axzz1ZvQRmIcj

I've narrowed down the problem to the header file by deactivating all plugins, and when I reverted the header.php file back to the original it didn't do it anymore. I'd just like to know i开发者_如何学编程f anybody's aware of a similar problem and what might be the cause so I can keep my redesigned header with a fix for the problem.

Thanks


I was so freaked out and perplexed by this problem and it turned out to be being caused by the 'AddThis' code.

If you check the option "Track address bar shares" while getting the code, this happens. If you uncheck it the problem is solved.

BTW it is unchecked by default and I had checked it.


It's not PHP; it's javascript - you surely noticed how, with javascript turned off, it does not happen.

Look for some instances of window.location.hash in the plethora of js files you're using. There's quite a few but hint: the one you're looking for is not in jQuery.js.

Other hint: wht's that javascript file that has a lot to do with internal anchors?

0

精彩评论

暂无评论...
验证码 换一张
取 消