Add Adsense After 1st and Last Post in vBulletin Mobile Style

A couple weeks ago I showed you how to add Goolge Adsense to your vBulletin Mobile Sytle. I got an email from someone looking to add Adsense between the first and last post in a thread.

So I’m happy to share how to do it here.

First open up you mobile suite under your style manager in your admincp

Open your postpit_legacy and add this to the very bottom:

<vb:if condition="$post[postcount] % $vboptions[maxposts] == 1 OR $post['islastshown']">



<br />
<br />

There are lots of different variables that you can use like showing ads just to certain users or non members or show only in certain forums, etc. This code will also work in the regular vBulletin style.

Why another blog about forums? Great question, we are just a couple of forum owners who have built ours forums from the ground-up. We just wanted a blog for real life forum owners, with real life experiences.

View all contributions by

Get more updates by subscribing

Leave a Comment

  • Rafa November 16, 2012, 2:16 pm

    Thanks for your post, but don´t work for me, when I put the code in postbit default mobile style I can see below the first post the Google Code directly, no ads.
    I have VB 4.2.0

    • James November 16, 2012, 4:20 pm

      Hi Rafa,
      Sorry for the trouble you’re having.
      So you’re seeing the code itself? If so it’s possible that you didn’t grab all the code for Google Adsense. I just double checked mine and it still works. Let me know wheat your seeing and I’ll be willing to help you out further to get it solved for you.

  • Fernando Vieira June 4, 2013, 3:34 am

    Thank you so much for sharing this! It worked beautifully!

  • Mike McKoy May 8, 2015, 1:10 am

    Curiously… do you have a running forum where we can see an example of this? I really would like to know how to get the ads to appear after the first, third, and sixth thread titles in forums display