Count overall posts Ad Placement (2 posts)

  1. anthonyb
    Posted 6 years ago #

    I have seen alot of scripts and posts about placing an ad based on counting the number of posts that are printed via the loop.. (ex: every 2 posts.. etc)

    What I would like to do is have an overall count, not just page specific... For example, since my blog only shows 10 posts per page, and I wanted to display an ad every 15 posts.. Is this possible? Is there a way to count from the beginning of the first page back?

  2. anthonyb
    Posted 6 years ago #

    After thinking about this..

    I think the best way would be to simply count all the posts.. with wp_count_posts

    Then saying something like ... every 15.. print this..

Topic Closed

This topic has been closed to new replies.

About this Topic