Insert google ad inbetween first and second post
-
On some blogs, I’ve seen folks insert their google ad inbetween the first and second post on the main page. How would I go about doing this? Right now, I ususally put my Google code in the sidebar, but I’d like to insert in between the first and second post instead.
I imagine I would have to modify part of the Loop in my index.php, but I don’t know where to start. I’m using the cool Kubrick template which has the following in the index.php:
[code]
<?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
<h2 id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
<small>/<?php the_time('m') ?>/<?php the_time('j') ?>/"><?php the_time('l') ?>, /<?php the_time('m') ?>/"><?php the_time('F') ?> /<?php the_time('m') ?>/<?php the_time('j') ?>/"><?php the_time('jS') ?>, /"><?php the_time('Y') ?> by <?php the_author() ?> <?php edit_post_link('Edit','(',')'); ?></small>
<div class="storycontent">
<?php the_content('Read the rest of this entry »'); ?>
</div>
<p class="postmetadata">Posted in <?php the_category(',') ?> | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »','permanent.php'); ?>
<!--
<?php trackback_rdf(); ?>
-->
<?php } // closes printing entries with excluded cats ?>
<?php } else { // end foreach, end if any posts ?>
Sorry, no posts matched your criteria.
<?php } ?>
[/code]
Any help would be appreciated. Thanks!
- The topic ‘Insert google ad inbetween first and second post’ is closed to new replies.