• 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

Hide adsense ads on specific pages/posts

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 › Hide adsense ads on specific pages/posts

This topic is: not resolved
  • This topic has 3 replies, 2 voices, and was last updated 11 years ago by rajaindian.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 12, 2015 at 1:39 am #144128
    rajaindian
    Member

    Hi, I am adding Adsense code using the genesis simple hooks plugin. I am trying to hide the ads on specific posts pages using the following code 9

    <?php if ( !is_single( array( '20584' ) ) ) { ?>
    	<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- Lab-training.com  Link unit under top navigation -->
    <ins class="adsbygoogle"
         style="display:inline-block;width:728px;height:15px"
         data-ad-client="ca-pub-2xxxxxxx"
         data-ad-slot="xxxxxxxx"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    <?php } ?>

    but it is not working. Please help me solve the problem

    March 23, 2015 at 6:57 pm #145390
    Ren Ventura
    Member

    First, make sure that 20584 is the correct post ID. Next, is_single() will not work for pages so you'll need to use is_page().


    Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren

    March 23, 2015 at 11:26 pm #145418
    rajaindian
    Member

    Thank your for your inputs, but it is still not working!

    This is the page http://lab-training.com/certificate-courses/

    March 23, 2015 at 11:27 pm #145419
    rajaindian
    Member

    Hi, It is working.

    Thank you so much, I just needed to flush the cache first.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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

© 2026 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