- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by
Elvin.
-
AuthorPosts
-
February 22, 2021 at 7:53 pm #1668574
April
I’m trying to get Skimlinks to work on my site. They provided javascript code to be placed “just before the /body tag”. I created a hook in Elements which is assigned to wp_footer for the entire site.
When I use a Skimlinks test link, it says the installation failed. I’ve tried deleting the page cache but it’s not working. Any ideas? Thanks.
February 22, 2021 at 8:05 pm #1668587Elvin
StaffCustomer SupportHi there,
Does Skimlinks have a documentation or any guide on how to install their product/s?
This seems like a question on how to install Skimlinks. If this is the case, it’s best to ask the developer on how to install this on a WordPress site.
Note: I’m not exactly sure if this works but try this out – https://dougiehunt.com/beginners-guide-to-installing-skimlinks-on-wordpress/ (step 2 isn’t exactly necessary if you follow this – https://docs.generatepress.com/article/adding-php/ – as its mainly for letting you add PHP snippets)
February 22, 2021 at 8:59 pm #1668631April
Skimlinks provides info how to install in WordPress there is no “editor” option under Appearance in GP. That’s why I’m coming to GP, not Skimlinks, because it appears to me to be a WordPress difference due to the template (let me know if that’s incorrect). See step 2 in the instructions provided: https://support.skimlinks.com/hc/en-us/articles/223836108
To clarify my questions:
1. If code needs to be placed just before the “/body” tag, did I do it correctly by using a hook assigned to wp_footer? Or should it be a different type of footer?
2. If the code that was provided to me (by Skimlinks) is javascript, should that work when it’s pasted into a hook?February 22, 2021 at 9:12 pm #1668647Elvin
StaffCustomer Support1.) It’s the right hook but I think you have to change the priority if the script must go directly before the
</body>closing tag. Try setting the priority of the Hook to99to do this.say for example you have this:
add_action('wp_footer',function(){ ...code here... } );You can add the priority by doing this:
add_action('wp_footer',function(){ ....code here... }, 99 );2.) Yes it should as it on the Hook Element’s code area. It’s actually inserted as shown here: https://share.getcloudapp.com/OAug8Kw2 – It just happened to not be placed right before the closing body tag.
February 22, 2021 at 9:23 pm #1668650April
Awesome. I set the priority in the hook (it’s in the option). Looking at the source code I can now see it right above /body. (I’m still getting an install error, but I’ll hit them up now that I know it’s in the right place.) Thanks!!
February 22, 2021 at 9:42 pm #1668656Elvin
StaffCustomer SupportNo problem. Hope it gets sorted. 😀
-
AuthorPosts
- You must be logged in to reply to this topic.