How To Display Adsense On Home Page

Community Forums Forums General Discussion How To Display Adsense On Home Page

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  JamesPenn 1 year, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23471

    JamesPenn
    Participant
    Post count: 3

    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 468×60 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

    #23476

    tomos
    Participant
    Post count: 12

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

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


    #23477

    JamesPenn
    Participant
    Post count: 3

    Excellent – thank you!

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

    Thanks,

    James

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.