• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Block Adsense ads on certain pages

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Block Adsense ads on certain pages

This topic is: not resolved

Tagged: adsense, Simple Hooks

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 10 months ago by BP.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 25, 2015 at 6:58 am #163411
    BP
    Member

    I'm using Genesis - Simple Hooks at "genesis_after_post_content" using the code below to place Google Adsense ads on all my "pages." Is there a way to block the ads from appearing on certain pages by placing some kind of code on that page or other place? BTW, I using the Prose theme. TX

    <?php if (is_page() ) { ?>
    <p>
    <<< Google Adsense Script >>>
    </p>
    <?php } ?>
    <br>


    Brad

    August 25, 2015 at 6:41 pm #163501
    Brad Dalton
    Participant

    Try

    ! is_page(array('1,2,3,4,5')))

    And swap out the page i.d's in the above example.


    Tutorials for StudioPress Themes.

    August 26, 2015 at 7:25 am #163561
    BP
    Member

    Thank you, Brad, but I cannot get it to work. Result with most tries was Adsense ads were blocked below the title on all "pages." I assume the page ID is at the end of the "short link," correct?

    Should your code somehow replace or be added to the following, which is in Genesis > Simple Hooks. I tried many variations, but I'm no code expert.

    <?php if (is_page() ) { ?>

    Your help is greatly appreciated.


    Brad

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble