Miscellaneous

How can I show a banner between every X topics?

Scenario:
"I'd like to put an advertisement/banner every X blog items like so:

Article 1
Article 2
Article 3
Article 4
Banner
Article 6
Article 7
Article 8
Article 9
Banner


How can I do this?"

Solution:
Edit the Main Index skin part to use the <%blog%> and <%otherblog%> variables with Nucleus' inbuilt offset function:

<%blog(templatename,5)%>
<!-- banner code -->
<%otherblog(shortblogname,templatename,5(6))%>
<!-- banner code -->

In the above code, Nucleus will display 5 items, followed by a banner, then the next 5 items, followed by another banner.

Further reading:

  • Use the above in conjunction with a randomizing plugin such as NP_Random to change which banners are displayed.
  • Read more on using an offset number in the <%blog%> variable.
  • section: Miscellaneous | submitted by Leng on 2006.Apr.22 | 3436 views

    item rate
    Total votes: 3 - Rating: 6.00

    Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

    10