• Hi,

    I’ve just installed WordPress today, and I want to add some ads on it. I’ve already figured it out how to add the Google ads in the sidebar, but I can’t find out how to add before the post.
    I would like to have some ads right under the header. So just before the posts start. I don’t know which file I should edit then…

    If any1 could help me with it please, I would really appreciate it.

    Thanks in advance,
    Saryon

Viewing 6 replies - 1 through 6 (of 6 total)
  • Above the first post ?

    Put the code above that line below.

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    If you mean right “under the header” but within the “header”, then put them inside of the closing tag for the header section.

    There are more specifics for laying out headers and the code used within them at http://codex.wordpress.org/Designing_Headers

    If you want a “banner” across but below your header, you can add a new “div” in your header.php below the header codes that will incorporate the ads within that.

    If you want them right above the first post, then do what podz says.

    Just giving you a few options.

    Thread Starter saryon

    (@saryon)

    Thx for the help 🙂
    But podz, in what file is that?

    That line is the beginning of the_loop (which actually displays your “blog”). It’s usually found in index.php, though I have seen themes where it’s elsewhere. If it’s not in your index.php (in your theme folder), post back with which theme you’re using.

    Question —

    How do you get the ad unit only above the first post,so only 1 ad unit shows per page?

    Placing the adsense code below
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    will give you 3 units if there are 3 posts, and if there are 20 posts, there will be 20 requests sent to Google, which I think might violate their policies.

    I just want one unit in order to raise my EPC 😛

    nevermind, justed placed AdSense code above the loop, under the content div

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Putting ads in blog’ is closed to new replies.