1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Styling and Customization Questions' started by trman, Jan 16, 2015.

  1. trman

    trman 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.
  2. jeffwidman

    jeffwidman Active Member

  3. trman

    trman 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.

  4. jeffwidman

    jeffwidman 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" />
    eva2000, Sean Kendle and marremp2 like this.
  5. trman

    trman Active Member

    Thanks Jeff, that worked!

    Do you know how I could also implement this on the listing of New Posts?
  6. trman

    trman 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">

Share This Page