<script type="text/javascript"><!--would be copied to this location in the default style sidebar.php:
google_ad_client = "pub-X";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</ul>You can experiment with various places
</li>
<?php } ?>
<-----paste it there
</ul>
</div>
<body>
<-----paste the code there
<div id="page">
</div>
<-----paste the code there
<?php get_sidebar(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>Immediately above that, paste this:
<?php
$postnum = 1;
$showadsense1 = 1;
?>
<p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>Into that gap, you paste this:
</div>
<----- Note this gap !
<?php endwhile; ?>
<?php if ($postnum == $showadsense1) {You put ALL your code, plus the bit at either end, into the gap I pointed at.
echo '
Your adsense code goes here
';
} ?>
<?php $postnum++; ?>
<?phpwhich would go at the top.
$postnum = 1;
$showadsense1 = 1;
$showadsense2 = 2;
?>
<?php if ($postnum == $showadsense1) {and you would add another block below the first ad, but above the counter at the bottom. Here it is all together:
echo '
Your adsense code goes here
';
} ?>
<?php $postnum++; ?>
<?php if ($postnum == $showadsense1) {The first bit says the values, then the values are checked each time WP goes through The Loop.
echo '
Your adsense code goes here
';
} ?>
<?php if ($postnum == $showadsense2) {
echo '
Your adsense code goes here
';
} ?>
<?php $postnum++; ?>
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>If you are not using such a theme, you need different code.
<?php
if (is_single()) { echo '
Your adsense code goes here
';} ?>
These pages are independent of http://wordpress.org
All design, content & images © Mark 2004-2008. All rights reserved.