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

XF 1.4 Ads between first and second post

Discussion in 'XenForo Questions and Support' started by Adrian D., Dec 27, 2015.

  1. Adrian D.

    Adrian D. Member


    I have used this as refference to include my adsense banners https://xenforo.com/community/resources/visual-list-of-ad-locations.1383/ however I couldn't find anything about placing ads between first and second post.

    The after first post threads that I've found like this one https://xenforo.com/community/threads/ad-after-first-post-which-template.17313/ places the banner too close to the post content and it's not what I want. A working example of adsense placed between first and second post of each thread: http://prntscr.com/9j6cq5 , as you see it's totally separated from the post content.

    Also using <li></li> to wrap the adsense banner into a nice container with the ad_thread template (except ad_thread_view_below_messages which works fine) breaks the forum style, no matter what I'll do and blanks the second post of the thread.
  2. AndyB

    AndyB Well-Known Member

  3. Brogan

    Brogan XenForo Moderator Staff Member

    Amaury and Liam W like this.
  4. Adrian D.

    Adrian D. Member

    Thanks, I have already used the following conditional statement prior to opening this thread.

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    adsense banner

    However as I have already mentioned the banner gets too close to the post content (acts like a signature) and I want to be separate between first and 2nd post just like in the screenshot I've posted as an example.
  5. Brogan

    Brogan XenForo Moderator Staff Member

  6. Adrian D.

    Adrian D. Member

    Doing that already with a <li> but wraping it with the <li> tags breaks the design, second post turns into blank and the post height is changed to some big value.

    Also I don't intend to make it look as a post as shown in your example.
    Last edited: Dec 27, 2015
  7. Brogan

    Brogan XenForo Moderator Staff Member

    You don't need to use li tags.

    Just use the html and css you want to achieve the effect you want.
  8. Adrian D.

    Adrian D. Member

    The only issue here is why the <li> tags are breaking the design when are added in the ad_message_below and I've seen there are quite a few people on xenforo having the same problem witht he li tags messing up the design when being added (this guy over here has it too https://xenforo.com/community/threads/ad-after-first-post-which-template.17313/#post-888554)

    Alright, a workaround that I've did was to drop the <li> tags and create a new div container adding a margin-top in order to get the same effect I would get with <li> tags and seems to work fine.
    Last edited: Dec 27, 2015
  9. Brogan

    Brogan XenForo Moderator Staff Member

    I don't have any issues using li tags.
    I have also in the past inserted ads without them, again without any issues.

    Perhaps it's an issue with your custom style, or the markup you are using.
  10. Blinky

    Blinky New Member

    I will use this thread to put my question, if it's OK. I think it is related to it.

    In a few words - I want to insert an ad spot in every single first post of a thread. Here is how it should look like:

    Screenshot from 2017-02-11 23:30:17.png

    Does someone already integrated that way? And if he does, would he give us an idea how? Any suggestions will be appreciated. :) Thanks in advance and hope to help me here.

    All the best,
  11. Dadparvar

    Dadparvar Well-Known Member

    use this small addon and see how things work:
    Anyway there is a great paid one too.
  12. Blinky

    Blinky New Member

    Thanks a lot for your reply. I prefer to add this it in some of the templates, because I use Revive Adserver, and implementation is easy, just need to know where in the templates with some condition of course in order to be only showing in the first post. :) Any advice is welcome.not big fen of adding add-ons for every simple code adding. Thanks a lot once again. :)

Share This Page