Hi,<br /><br />Does anyone know how to add Adsense code after the first post in Wordpress? <br /><br />Not sure if it will be custom scripting or a plugin, but any advice would be welcomed.<!--content-->
well this is a bit late but theres a plugin called adman!<!--content-->
Hi SEOLover,<br /><br />Here is a quick solution, make sure you back up the file before trying this though.<br /><br />Open your index.php in your PHP editor or through the Wordpress control panel and find this line:<br /><br /><?php if (have_posts())<br /><br />before this, add:<br /><br /><?php $count = 1; ?><br /><br />The number tracks which post is being displayed. Now add the code to display your Adsense adverts.<br /><br />Find..<br /><br /><?php the_content<br /><br />And after that add..<br /><br /><?php if ($count == 1) : ?><br />Adsense Code Goes Here<br /><?php endif; $count++; ?><br /><br /> <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid="" border="0" alt="wink.gif" /><!--content-->
well this is a bit late but theres a plugin called adman!<!--content-->
Hi SEOLover,<br /><br />Here is a quick solution, make sure you back up the file before trying this though.<br /><br />Open your index.php in your PHP editor or through the Wordpress control panel and find this line:<br /><br /><?php if (have_posts())<br /><br />before this, add:<br /><br /><?php $count = 1; ?><br /><br />The number tracks which post is being displayed. Now add the code to display your Adsense adverts.<br /><br />Find..<br /><br /><?php the_content<br /><br />And after that add..<br /><br /><?php if ($count == 1) : ?><br />Adsense Code Goes Here<br /><?php endif; $count++; ?><br /><br /> <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid="" border="0" alt="wink.gif" /><!--content-->