• 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

How To Display Adsense On Home Page

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 › General Discussion › How To Display Adsense On Home Page

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 12 years, 8 months ago by JamesPenn.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 1, 2013 at 5:03 am #23471
    JamesPenn
    Member

    Hi guys,

    Very quick question that I hope is easy to resolve.

    Following instructions I found in another thread, I have managed to add a Google Adsense ad above the first post on my category pages - e.g. the 468x60 banner at the top of this page: http://www.herbsandoilsworld.com/category/health/

    I'd also like to show the same ad above the first post on the home page.

    Here is the code I'm using in the genesis_before_loop hook.

    <?php

    if (is_category())

    { ?>

    GOOGLE ADSENSE CODE

    <?php

    }

    ?>

    Could you please let me know what I need to change about this code to also show ads on the home page?

    Thanks in advance.

    James

    March 1, 2013 at 5:49 am #23476
    tomos
    Member

    Maybe try changing your if statement and adding is_home():

    if( is_category() || is_home() ) { //adsense code here }


    @tomoswyn

    March 1, 2013 at 5:55 am #23477
    JamesPenn
    Member

    Excellent - thank you!

    I knew it was something like that I just didn't know the exact code.

    Thanks,

    James

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ 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