AdSense afteer first post?

Discussion in 'WordPress' started by Chr1ssst0pher, Jan 23, 2008.

  1. #1
    Hi everyone. I know that most of you prefer wordpress but I'm sure that some of you have tried blogger. so my question is How to put AdSense ad after first post? I suspect that I should paste that ad code somewhere in template code but I've only found how to put it after every post:( and I need only after first one.
     
    Chr1ssst0pher, Jan 23, 2008 IP
  2. chickuzt

    chickuzt Banned

    Messages:
    115
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well I found one good adsense template for wordpress; you need to customize it a little but it works. Just look at their template index.php and css to see how theirs works.

    It is Super Adsense Theme, you can see it being implemented on the site in my sig.
     
    chickuzt, Jan 23, 2008 IP
  3. Chr1ssst0pher

    Chr1ssst0pher Peon

    Messages:
    564
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanx, will try to work it out:) I was hoping someone will generously provide some kind of code... I've found almost similar threads here but no hint on how to do this on free blogger:(
     
    Chr1ssst0pher, Jan 23, 2008 IP
  4. sitedesigner

    sitedesigner Peon

    Messages:
    578
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    can you direct link us please?

    thanks
     
    sitedesigner, Jan 23, 2008 IP
  5. add_cents

    add_cents Peon

    Messages:
    961
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That's a great theme. Thanks.
     
    add_cents, Jan 24, 2008 IP
  6. cybersquate

    cybersquate Banned

    Messages:
    413
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ANYONE can do this!

    1. In the PRESENTATION menu, under THEMES EDITOR, find the theme file called “Main Index Template” (index.php).
    2. FIRST: Copy and paste everything you see here into a blank text file and save it. This way if you screw something up you can revert back to the original without hurting anything.
    3. Find a line of code that looks much like the following: <?php the_content('Read the rest of this entry »'); ?>
    4. Immediately after that, paste the following: <?php if ($count == 0) : ?> ENTER YOUR AD CODE HERE <?php endif; $count++; ?>
    5. Save the document and refresh your page. You should see the ad ONLY after the first article on the homepage.


    So as an example, here is what the code might look like when installed (the red part is the new part):

        <div class=”Post”>
              <div class=”PostHead”>
                   <h1 class=”title”><?php the_title(); ?></h1>
                   <p class=”PostInfo”>Posted on <?php the_time(’M d, Y - g:ia’); ?> <?php comment_time() ?> by <?php the_author() ?> in <?php the_category(’, ‘) ?></p>
              </div>
              <div class=”PostContent”>
                   <?php the_content(’Read the rest of this entry »’); ?>
              </div>
        </div>
        <?php if ($count == 0) : ?>
        <div class=”frontpage-google-ad” style=”border: dashed 1px black; padding: 10px” align=”center”>
              <script type=”text/javascript”><!–
              google_ad_client = “pub-0617773482327857″;
              google_ad_width = 468;
              google_ad_height = 60;
              google_ad_format = “468×60_as”;
              google_ad_type = “text_image”;
              //–>
              </script>
              <script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”></script>
        </div>
        <?php endif; $count++; ?>
    Code (markup):
    Hope this can helped you out...

    Rep appriciated :)
     
    cybersquate, Jan 24, 2008 IP