XF 1.4 Ad on thread list between 5th and 6th thread listing


Active member
I would like to put an ad in the thread list between the 5th and 6th thread listing, after the stickies. Also would like to put an ad on the new posts list between the 5th and 6th thread listing. I tried searching but found nothing that worked for me.

Any help is appreciated.


Active member
Thanks Jeff but I had previously read that thread and couldn't get it to work. I kept getting a server error when I tried to save the code. Can you elaborate more on how you installed it? Such as where in the thread_list the code that SuperJett provided goes? Anything else that needs to be done? Step by step is what I really need.



Active member
Here's how I did it--some of this code exists by default, some of it is changed. I've underlined the changes.

<xen:include template="ad_thread_list_below_stickies" />

<xen:hook name="thread_list_threads">
<xen:foreach loop="$threads" value="$thread" i="$i">
<xen:if is="in_array({$i}, array(9, 15))">
<xen:include template="ad_thread_view_between_threads" />

<xen:include template="thread_list_item" />


Active member

I figured out that you can use the same code on the find_new_posts template and it will work fine for the list of new posts.

Just start the code below:

<ol class="discussionListItems">