WordPress.org

Support

Support » Themes and Templates » [Resolved] Possible to add a google Ad in header?

[Resolved] Possible to add a google Ad in header?

  • Hi Awesome theme!

    Could you please assist / guide me in adding a 728px Google add to the right of the header?

Viewing 15 replies - 1 through 15 (of 28 total)
  • I have successfully added an ad position in header using author’s reply in other thread. Here is the link for that post.

    http://wordpress.org/support/topic/ads-11?replies=6#post-4906945

    Try it, it is easy. You will have to add some css styling to make it look good

    Here is the result.
    http://tinypic.com/r/2h7lx6v/5

    Would you be so kind as to share your code + steps?

    First add the following code in header.php

    <div class="ads-header-desktop">My ads here</div>

    Replace “My ads here” with your adsense or other ad tag.

    Then in custom css add the following styling,

    .ads-header-desktop {
        display: block;
        float: right;
        margin-right: 5px;
        margin-top: -95px;
    }

    You may need to change the top and right margin values to suit your website design.

    You will also need to add the following code in custom css to disable the ad from showing in smaller screens.

    /* hide or display */
    .ads-header-desktop { display: block; }
    
    @media only screen and (max-width: 800px) {
    .ads-header-desktop { display: none; }
    }

    Perfect thank you!

    This is Great. I would try this out. Are d ads banners also gonna be changing?

    Hi,
    Thanks for awesome theme,

    Can you explain me little bit more about where to insert codes? In header.php after which line should I insert it so that adds will show right next to (right of) site description?

    Thanks

    Also is there any way to take site description under site title? Instead of being next to each other, can it be under site title?

    I’ve placed my code after the <h1 class=”site-title”> in header.php.

    hi aeroomkar

    Thanks for the tips, This is what i want

    I want to do the same thing and would be over my head with creating a child theme so thought I would follow these instructions and just redo it every time there is a site update.

    When I looked in the Header.php file, I couldn’t find <h1 class=”site-title”> at all.

    I’m also pretty new to Adsense, and so far have just pasted code into text widgets. What do you mean by the tag (to replace your text My Ads Here)?

    Appreciate your help!

    @karenstl

    Just put the code to where you want to appear on header
    Replace text My ads here is replace that sentence with your ads code

    @karenstl be aware every theme uses different structure … so it never means that you can do that step for any theme and you are done …. just think for your own theme and the above said theme …. if these both are same, then these steps will work, else you have to make change according to your own theme …? now its on you, are you using same theme?

    I am using Hueman. I don’t know code so I have no clue where to place the code in the header.php file. I’m really good at pasting when someone tells me where.

    I also saw that the version I’m using is a lite version as it was downloaded fro WP.org and not from the developer’s site. I tried downloading it off his site but just got a blank page. Maybe if I can sort that out then the <h1 class=”site-title”> will shop up in that file.

    @karenstl

    you can put the code after line 48 on header.php

Viewing 15 replies - 1 through 15 (of 28 total)
  • The topic ‘[Resolved] Possible to add a google Ad in header?’ is closed to new replies.