XF 2.2 How Place Ads Inside First Post

biafraland

Member
Hello,

I'll like to place ads inside the forum's first post (either left-aligned or right-aligned). Is there any mod or code to achieve this?

I have tried editing the thread_view template but couldn't get the ad to show inside the post. The closest I could get was beside the "watch" button which is far from what I'm looking at, and the Digital Point Ad Positioning add-on that does something similar isn't available for 2.X.


Note: I'll be fine with knowing the line (in thread_view template) where I can place an ad code and have it show up inside the thread.

Ad code example:

HTML:
<div style="text-align:left;">
    ad code here
</div>
 

Attachments

  • place ads inside post.webp
    place ads inside post.webp
    45.9 KB · Views: 36
Solution
Use one of the built in ad positions:

1627077015955.png

Wrap the ad in a conditional statement so it only shows in the first post:

HTML:
<xf:if is="$post.position == 0">
    Ad here
</xf:if>
Use one of the built in ad positions:

1627077015955.png

Wrap the ad in a conditional statement so it only shows in the first post:

HTML:
<xf:if is="$post.position == 0">
    Ad here
</xf:if>
 
Solution
Back
Top Bottom