can you please share the trick with us.. i mean how did you do this.. even i use WP and it will prove helpfull... thankz in advance
Ok here goes - this is the index.php in the theme editor. paste the php marked [HERE] in the same place as I have in the WP loop to get the sdsense below the first post only. the blog in question is Angling There are only 2 pices of script. <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php if (have_posts()) : ?> [HERE]<?php $showAdSense = True; ?>[HERE] <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> </div> [HERE]<?php If ($showAdSense) { ?> <h2>Fishing and Angling</h2><br><script type="text/javascript"><!-- google_ad_client = "pub-XXXXXXXXXXXXXX"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "3D81EE"; google_color_text = "000000"; google_color_url = "000000"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <?php $showAdSense = False;} ?>[HERE] <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries »') ?></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> <table width="450" height="220" border="1" cellspacing="0" bordercolor="#EEEEEE"><tr bordercolor="#999999" bgcolor="#BFD2C8"><td height="15" colspan="3" nowrap class="largertext"><div align="center"><strong><font color="#004000" size="2" face="Tahoma, Arial">More <a href="http://www.tacklebargains.co.uk/discount_fishing_tackle.htm"><font color="#004000">Discount Fishing Tackle</font></a> Offers from <a href="http://www.tacklebargains.co.uk" target="external"><font color="#004000">Tacklebargains</font></a></font></strong></div></td></tr><tr><td width="33%" height="205"><div align="center"><script src="http://www.tacklebargains.co.uk/randomimage.js"></script><script>SetAffiliate("428767");this.document.write(TextList[NumArray[0]]);</script></div></td><td height="205" width="33%"><div align="center"><script>this.document.write(TextList[NumArray[1]] );</script></div></td><td width="33%" height="205"><div align="center"><script>this.document.write(TextList[NumArray[2]]);</script></div></td></tr></table> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> PHP:
Thanks Jim bob for the script! I was looking for something simple like this, and my PHP skills are non-existent Although I changed the H2 hearer to "Sponsored Links" for now because having it as a post heading title like yours (Fishing and Angling) might be against the G-TOS. Thanks again!
I will have a look at the plugin. I have tried a couple of adsense plugins and they have been problematic. How easy is Adsense delux? Jamie
This worked for me, and it's simple: http://www.alittlenerdy.com/2006/10/02/adsense-after-first-post-in-wordpress/