If you’re using the default home page layout, give this a try:
1. Create a new sidebar in Theme Options > Sidebars; give it a unique id like “sidebar-ads” or whatever you like.
2. In Widgets, add a text widget to the sidebar, then place your ad code in the widget.
3. Copy index.php from the parent theme to your child theme.
4. In your child theme index.php file, find the following code block:
<div class="post-list group">
<?php $i = 1; echo '<div class="post-row">'; while ( have_posts() ): the_post(); ?>
<?php get_template_part('content'); ?>
<?php if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>
</div><!--/.post-list-->
5. Replace that block of code with this:
<div class="post-list group">
<?php $i = 1; // initialize the post counter
echo '<div class="post-row">'; // create the post-row div
while ( have_posts() ): the_post(); ?> <!-- while we have posts -->
<?php get_template_part('content'); ?> <!-- display the post -->
<?php if ($i % 2 == 0) { // if we've shown 2 posts
echo '</div>'; // close this post-row div
// BEGIN insert my custom widget after 6 posts
if ($i % 6== 0) { // if we've displayed 6 posts
echo '<div class="my-ad-widget">'; // create the widget div
dynamic_sidebar('sidebar-ads'); // show the widget
echo '</div>'; // close the widget div
}
// END insert my custom widget
echo '<div class="post-row">'; // create the next post-row div
}
$i++; // increment the post counter
endwhile;
echo '</div>'; // close the trailing post-row div
?>
</div><!--/.post-list-->
6. Add the following css to position the sidebar:
.my-ad-widget {
float:left;
}
Let me know if you have any questions.