Plugin Author
malihu
(@malihu)
Hello Eric,
You are correct about the targets being inside SiteOrigin widgets as they probably don’t allow custom shortcodes etc.
I checked your link and the new id targets you’ve set are correct. Basically, everything is correct and working except that Shapely uses its own page scrolling function which (aggressively) prevents other plugin scripts like “Page scroll to id” from working.
Go to “Page scroll to id” settings and try enabling “Prevent other scripts from handling plugin’s links” option. This should do the trick 😉
Also, the offset selector you’ve set (#main-menu) is not correct as it seems there’s no element with id main-menu in your page. If you want to offset your top sticky menu, change “Offset” value to #site-navigation
Hope this helps
Hey Malihu,
Thanks for your prompt reply!
I’m afraid its still not working. I found this post and tried adding the code you provided to header.php, but to no avail.
Any other suggestions besides getting a new theme?
Many thanks,
Eric
Plugin Author
malihu
(@malihu)
No problem.
No need to add the code you found as it’s probably for an older version of Shapely and it won’t work in your case.
The “Prevent other scripts from handling plugin’s links” option cannot always work as it depends on how the theme works. In your case, the theme seems to add an event on the list-item (li) so you have to do this manually.
The script that does this is:
...themes/shapely/js/shapely-scripts.js
and the code/function is from lines 85 to 93.
You need to edit this script and either comment (i.e. remove) the code between these lines:
/* $('.menu li').click(function (e) {
...
}); */
or change line 85 from:
$('.menu li').click(function (e) {
to:
$('.menu li').not('.ps2id').click(function (e) {
so it doesn’t mess with link items that have the ps2id class (i.e. link items handled by “Page scroll to id”).
I don’t know if the above sounds like too much work but sometimes themes don’t like playing along other scripts/plugins.
Let me know if this works
Thanks so much! This totally works – I used the second solution that you suggested… except for the first link that you click upon loading the page. It doesn’t do the scrolling on that first click, but then it works. Any thoughts as to why?
Thanks for your excellent support!
-Eric
Plugin Author
malihu
(@malihu)
You’re welcome.
It’s working on first click for me (tested it just now). Maybe you were seeing a cached version of the page?
Ah – it must have been a cache thing.
Thanks again!