WordPress.org

Ready to get started?Download WordPress

Forums

How to add ads on front page and category? (4 posts)

  1. evilmc
    Member
    Posted 2 years ago #

    How to add Google ADS after third and sixth post on front page and category?

    Like a this: http://i47.tinypic.com/2vnj7ld.png

  2. colorvila
    Member
    Posted 2 years ago #

    You need to edit your theme to achieve this.
    I think the flexible solution is:
    1.Add a filter at the front page where you want to show your ADS.
    2.Insert any things you want in the filter.(Certainly can be your ADS.)

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    search the ad (adsense) plugins http://wordpress.org/extend/plugins/ - some of them might be able to do what you want.

  4. evilmc
    Member
    Posted 2 years ago #

    I change main index template and category:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    Replace with:

    <?php if (have_posts()) : $i=0; ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php if($i++==3) : ?>
    YOUR CODE HERE
    <?php endif; ?>

    <?php if($i==6) : ?>
    YOUR CODE HERE
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic