Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Resolved] How to stop a hook from running on a certain page

Home Forums Support [Resolved] How to stop a hook from running on a certain page

Home Forums Support How to stop a hook from running on a certain page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #592936
    Derek

    Hello,

    I have a before header hook that I don’t want to run on my home page. How can I disable this for my home page?

    Thank you!

    GeneratePress 2.1.2
    #592947
    David
    Staff
    Customer Support
    #593590
    Derek

    Ok so here one of the codes im working with:

    <?php if ( ! is_front_page() ) : ?>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({
              google_ad_client: "ca-pub-#########",
              enable_page_level_ads: true
         });
    </script>
    <?php endif; ?>

    It’s not working as is, I’m sure I missed something in how its formatted…I know zero about php so I just tried to follow the instructions. Suggestions?

    Thanks.

    #593626
    Derek

    False alarm it looks like its working, must have been a cache thing.

    #593776
    David
    Staff
    Customer Support

    Glad to hear you got it resolved.

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