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

XF 1.1 How do I add a single Ad within the 1st post only, in a thread?

For future reference (maybe it can help someone with the very same question of mine?), this is how I solved it:

<xen:hook name="ad_message_body" />
<xen:if is="{$post.position} == 0 AND !{$message.conversation_id}">
<div style="display: block; float: right; vertical-align: middle">
// here it goes my code
Thanks Brogan, really appreciate your help

Marco Famà

Active member
ciao Brogan,
is there another way to edit the following code

<xen:if is="!{$message.conversation_id} AND !{$ajaxInsert} AND {$post.position} == 0">
to make something appear only in the first post of each page?
If I remove the AND {$post.position} == 0 the banner gets replicated into ALL posts, and I'm not sure I understood why

Can you please help Brogan/all?


How can I show content after post x on every page in a thread?
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x AND !{$message.conversation_id}">
This content will show after post x on every page in a thread
hey Brogan
do you know if a conditional statement to check which browser the user is navigating forum froms, is available? Tried searching your link with no result... can you please help?