How to properly insert adsense codes please ?

  • Alex75017


    Dear all,

    I’m having trouble inserting adsense codes on my blog especially below the primary menu bar at the top of the page and within the articles (posts).

    I tried to add a widget in the header but it doesn’t display properly. Then I sought to add the code in the file single.php for InArticle adsense as recommended on a website but it seems that the code is different so I could not…

    I found in the customization menus, an option called “Ads” in “Graphene: General”, but when I tried to paste my adsense codes there and checked “show ads” and “front page”, nothing happened…

    Can anyone assist me in inserting properly the codes to have the ads displayed where I wish ?

    Thank you so much for your help,

    Kind regards,




    Edit : I’ve just noticed that the ads are now displayed in between the posts excerpts on the front page and archive pages + at the bottom of each post but nothing below the primary menu…
    (I pasted 2 different adsense codes in the Ads section of the customizing menu).

    Is it a random display or is there any possibility to choose the location of display ?

    Thanks again for any insight on this matter,



    Syahir Hakim


    The location is fixed – the ads are displayed in-between posts when on the home or archive pages. When on a single post page, the ad is displayed at the end of the post.

    To insert the ads elsewhere, you can use Graphene’s Action Hooks Widget Areas feature.



    OK thank you very much, I’ll have a look at those !
    The page seems very helpful 🙂



    Dear Syahir,
    After giving it some thought, I was wondering where in the theme files the location of the different types of adsense ads (InArticle, etc) were defined please ?

    For instance, where’s the code setting the location of Adsense at the end of the post in the case of InArticle adsense ?

    Thank you very much for your kind help,




    Hi Syahir
    Some time later, I m still struggling to change the ad’s location within the article. I would like it to be below the post title and not at the end of the post.

    I do not have graphene plus so the action hook is not enabled if i understood rightly.
    Therefore i would like to insert the adsense code manually in the right file to do so. Could you please guide me to do that please ?

    Thank you very much in advance,



    Edit: I have finally been able to enable the action hooks so everything works fine now!
    Sorry about my last unuseful question…



    Ps: getting back to this topic, I was wondering if there was any action hook allowing me to position the ad within the post, either after the introduction (and the tag “more”) or after 2 or 3 paragraphs of the post?
    If so could you kindly let me know which hook I should activate please ?

    Thank you so much in advance ☺


    Syahir Hakim


    Unfortunately there is no action hook for this, as the whole content is the post is generated by the WordPress function the_content(). There is a built-in WordPress filter hook to modify the content, but this will need a child theme and is more complicated to implement.

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

  • You must be logged in to reply to this topic.
Graphene Themes Forum