WordPress.org

Support

Support » How-To and Troubleshooting » Adding code after posts in archives

Adding code after posts in archives

  • I would like to be able to add advertising to my blog, but I only want to show the advert on the front page and in the archives.

    I would like to place an advert after every second or third post in a similar way to how http://www.engadget.com does, not after every post.

    Also I would like to mix up the adverts, so not every one is a adsense block.

    I guess the part of the code I need to be hacking is somewhere near here:

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

    and what I need to say is something like

    if post =1 do nothing
    if post =2 do nothing
    if post =3 show adsense
    if post =4 do nothing
    if post =5 do nothing
    if post =6 show chitika
    etc etc

    Is this something easy to do? Does anyone know of a plugin that might help?

    Thanks in advance – pilks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding code after posts in archives’ is closed to new replies.
Skip to toolbar