[Support request] Can’t load javascript on single page with hook

Home Forums Support [Support request] Can’t load javascript on single page with hook

Home Forums Support Can’t load javascript on single page with hook

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1632332
    Bonalair

    Hello,
    I have create a Hook but my javascript doesn’t work on single page.
    Could you please help me ?
    Thnaks

    #1632488
    David
    Staff
    Customer Support

    Hi there,

    what is the Javascript you want to add ?

    #1632506
    Bonalair

    Hello 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,
    JC

    #1632517
    David
    Staff
    Customer Support

    Looking at that script it should be added to the wp_head hook and make sure the Display Rules are set to Entire 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.

    #1632550
    Bonalair

    It’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 you

    #1632662
    David
    Staff
    Customer Support

    I 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 ?

    #1632667
    Bonalair

    Sorry 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,
    JC

    #1632682
    David
    Staff
    Customer Support

    So 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 the wp_footer hook to do that.

    #1632737
    Bonalair

    David,
    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.

    #1632861
    David
    Staff
    Customer Support

    Which hook do you have the script in now ? And can you move it to the footer hook so i can take another look?

    #1632868
    Bonalair

    Yes, wp-footer hook is already in place now.

    #1633481
    Leo
    Staff
    Customer Support

    Just 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 🙂

    #1633644
    Bonalair

    Hello 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.

    #1634556
    Tom
    Lead Developer
    Lead Developer

    The 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.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.