XF 2.2 show ads every 5th post

mscice

Member
Hello everyone can someone please help me with the code I need to use inside Posts template to show a ad every 5th post ?

Thank you
 
Give these a shot...

This one should display after the 1st, 6th, 11th, 16th and so on.
Code:
<xf:if is="{$post.position} % 5 == 1">
    AD CODE HERE
</xf:if>


This one should display after the 5th, 10th, 15th, 20th and so on.
Code:
<xf:if is="{$post.position} % 5 == 5">
    AD CODE HERE
</xf:if>
 
Top Bottom