Quote:
Originally Posted by Angry Jew Cat
exactly. it's not really anything i have any particular use for atthe moment, just curious while we're somewhat on topic if it's doable also? to say have a seperate banner on the index, page/1/, page/2/ and so forth. i know you could just stick a rotator in there, i'm speaking theoretically if you wanted to do this.
|
this is a way to do it
add this to functions.php
Code:
function do_pageads() {
global $paged;
if(!$paged) include (TEMPLATEPATH . '/front_ads.php');
else include (TEMPLATEPATH . '/other_ads.php');
}
sample index.php
Code:
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : ?>
<?php $count = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>
<div class="entry">
<?php the_content(); ?>
</div>
<?php if ($count == 2) : ?>
<?php do_pageads(); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
this will add your page ad after every 1st post on each page, calling the frontpage_ads or other_ads, add as many as you want.