[Resolved] Hooks Don't Work on New Elements Module

Home Forums Support [Resolved] Hooks Don't Work on New Elements Module

Home Forums Support Hooks Don't Work on New Elements Module

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #648449
    Zad

    Hi, I recently migrated to the new Elements module on GPP 1.7 and migrated all my hooks and deactivated “Hooks” and “Page Header”. For some reason, my hooks no longer seem to work.

    Here are the hooks I use.

    For wp_head

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-116104766-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'UA-116104766-1');
    </script>

    Also wp_head

    <link rel="stylesheet" href="https://use.typekit.net/lnt3pze.css">

    And wp_footer

    <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
    <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
    <script>
    window.addEventListener("load", function(){
    window.cookieconsent.initialise({
      "palette": {
        "popup": {
          "background": "#666666",
          "text": "#efefef"
        },
        "button": {
          "background": "#d46c5b",
          "text": "#efefef"
        }
      },
      "theme": "classic",
      "position": "bottom-right",
      "content": {
        "href": "https://www.lesslikely.com/privacy-policy/"
      }
    })});
    </script>
    #648454
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Have you cleared your caching plugin?

    If so and it’s not working, can you deactivate it so I can view your source?

    #648455
    Zad

    Sure, just deactivated my caching plugin. Yes, cache was also cleared

    #648456
    Zad

    Some other relevant information

    View post on imgur.com

    #648461
    Zad

    Oh okay, seems to work now! I think the problem was that I was using several browsers to check the cookie content popup, Mozilla and Safari, but they both weren’t accepting cookies. It is a bit odd though because I’ve never encountered this issue before on those browsers. Seems to work fine.

    #648462
    Zad

    Is there a particular priority I should put for each of these hooks? Would there be any problem with giving them all priority 1 etc?

    #648463
    Tom
    Lead Developer
    Lead Developer

    Priority shouldn’t matter for these hooks.

    Sometimes if you want an element to appear above or below another, you would use the priority.

    Glad it’s all working now 🙂

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