Support » Fixing WordPress » Adding adense code to template files!

  • How can I insert Adsense Ads into the template file so it appears in the Ist and 5th posts? I don’t want to insert it manually using the adsense deluxe plugin.

    Here’s the template code of index.php (the loop)

    <?php get_header(); ?>
    
    <div id="content">
    
    <?php include(TEMPLATEPATH."/l_sidebar.php");?>
    
    	<div id="contentleft">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    
    		<div class="postmeta">
    					<p><?php the_time('F j, Y'); ?> | Filed Under <?php the_category(', ') ?>&nbsp;<?php edit_post_link('(Edit)', '', ''); ?></p>
    		</div>
    
    		<?php the_content(__('Read more'));?><div style="clear:both;"></div>
    
    				<!--
    		<?php trackback_rdf(); ?>
    		-->
    
    		<?php endwhile; else: ?>
    
    		<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
    		<p><?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?></p>
    
    	</div>
    
    <?php include(TEMPLATEPATH."/r_sidebar.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

    Thanks in advance

  • The topic ‘Adding adense code to template files!’ is closed to new replies.