- This topic has 13 replies, 4 voices, and was last updated 3 years, 2 months ago by Tom.
-
AuthorPosts
-
January 25, 2021 at 1:28 am #1632332Bonalair
Hello,
I have create a Hook but my javascript doesn’t work on single page.
Could you please help me ?
ThnaksJanuary 25, 2021 at 3:42 am #1632488DavidStaffCustomer SupportHi there,
what is the Javascript you want to add ?
January 25, 2021 at 3:59 am #1632506BonalairHello David,
I have tried the “hook methode” but with no success.
It’s from Vibrant Media (https://www.vibrantmedia.com) and it was working good with my previous WordPress Theme.
My javascript is : <script type=”text/javascript” src=”//k.intellitxt.com/inteItllitxt/front.asp?ipid=XXXXX”></script>
Thanks you for your help,
JCJanuary 25, 2021 at 4:10 am #1632517DavidStaffCustomer SupportLooking at that script it should be added to the
wp_head
hook and make sure the Display Rules are set toEntire Site
( or the pages you want it to execute ).If you can do that and then link me to a page where the script should be, i can take a look to see if the hook is working.
January 25, 2021 at 4:36 am #1632550BonalairIt’s done. I can see it with Ghostery for Google Chrome (Vibrant Ads) but the in-text advertising doesn’t display. Here a link to the page : https://www.jcbtechno.com/
Thanks youJanuary 25, 2021 at 6:22 am #1632662DavidStaffCustomer SupportI just checked you site and i can see a banner advert above the content, and adverts in the sidebars on the home page.
Also see a pop up ad when clicking a post link.
And then in the content of a Single Post i can also see adverts being inserted.Maybe try clearing your browser caches ?
January 25, 2021 at 6:27 am #1632667BonalairSorry David,
But it is not the problem, My browser cache is cleared.
I can not see my in-text ads (green color).
If you can not help me, no problem. I’m going to ask refund and reinstall Schema wordpress theme.
Thanks you,
JCJanuary 25, 2021 at 6:44 am #1632682DavidStaffCustomer SupportSo i found this guide here:
https://www.vibrantmedia.com/de/wp-content/uploads/sites/2/2017/11/Vibrant-Implementation-Guide.pdf
So the scripts need to be fired after the content.
Try using thewp_footer
hook to do that.January 25, 2021 at 6:48 am #1632737BonalairDavid,
I already done this. It doesn’t work.
It’s working with other wordpress them but not with GeneratePress, and i don’t understand why.January 25, 2021 at 6:51 am #1632861DavidStaffCustomer SupportWhich hook do you have the script in now ? And can you move it to the footer hook so i can take another look?
January 25, 2021 at 6:54 am #1632868BonalairYes, wp-footer hook is already in place now.
January 25, 2021 at 5:57 pm #1633481LeoStaffCustomer SupportJust to make sure, it’s only not working on the home page?
If that’s the case, can you try disabling all plugins except GP Premium to test?
Let me know 🙂
January 25, 2021 at 9:51 pm #1633644BonalairHello Leo,
The problem is still here.
You can have a look on my website https://www.macplanete.com/
You will see it’s working very well with other WordPress theme like Schema (text link ads in green in single post).
Thanks you for your help.January 26, 2021 at 9:47 am #1634556TomLead DeveloperLead DeveloperThe theme doesn’t really matter when it comes to hooks like this – the hook isn’t aware of the theme, it simply adds what you want it to add.
As a test, let’s try some code that is completely separate from the theme – it would work with any theme you choose.
add_action( 'wp_footer', function() { ?> Code in here will be added to the wp_footer hook regardless of the theme you choose. <?php } );
GeneratePress itself doesn’t have the capability to prevent ads from being shown, so as long as the correct directions are being followed and the code is appearing in the source where it belongs, it should work.
-
AuthorPosts
- You must be logged in to reply to this topic.