Adsense on Gemer Theme
-
I’m using WP 3.0.1 and Gemer 1.0.2 http://ww.wp.xz.cn/extend/themes/gemer
The theme is setup so the main content area of the site has the following
+———————————-+
| |
| Featured Posts |
| |
+———————————-++—————+ +—————+
| | | |
| Odd Post “A” | | Even Post “A” |
| | | |
+—————+ +—————++—————+ +—————+
| | | |
| Odd Post “B” | | Even Post “B” |
| | | |
+—————+ +—————++—————+ +—————+
| | | |
| Odd Post “C” | | Even Post “C” |
| | | |
+—————+ +—————+etc etc
I would like to insert a Google Adsense after every 2nd row of “Odd” and “Even” posts. In the example above, I would love to see the Adsense between posts B & C. Additionally, it would cycle in pattern E & F, F & H etc etc.
I’ve found some code that allows you to count the post number, and insert the adsense based on the loop, but the wording on the forum topic and the Gemer theme do not align.
Is there a plug-in that could help me out? Is there a tutorial?
Here is the code from just below the Featured Post, to what I think is the end of the post code.
<!-- end featured news --> <?php $wp_query = $tmp_query; if (have_posts()) : $odd = false; while (have_posts()) : the_post(); $odd = !$odd; ?> <!-- begin post --> <div class="<?php if ($odd) echo 'uneven '; ?>post"> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <a href="<?php the_permalink(); ?>"></a> <?php $screen = get_post_meta($post->ID,'screen', true); ?> <img src="http://www.longislandfirealarm.com/images/rss_newspaper.png" width="181" height="100" alt="" /> <p><?php echo dp_clean($post->post_content, 150); ?></p> <div class="postmeta"> <p class="category"><?php the_category(', '); ?></p> <p class="comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p> </div> </div> <!-- end post --> <?php endwhile; ?>Thanks for the help.
The topic ‘Adsense on Gemer Theme’ is closed to new replies.