Jump to the post that solved this thread.
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 5 Years, 1 Month, 2 Weeks ago [How To?] add google adsense in first post
#1
Solved: 5 Years, 1 Month, 2 Weeks ago
How we can add google adsense only to 1st post of thread ? through code or any plugin available ?
thanks
Reply
#2
Solved: 5 Years, 1 Month, 2 Weeks ago
(12-05-2014, 07:00 PM)[email protected] Wrote: How we can add google adsense only to 1st post of thread ? through code or any plugin available ?
thanks
dear all, still waiting for any help, suggestions 
Reply
#3
Solved: 5 Years, 1 Month, 2 Weeks ago
Download Template Conditionals: http://mybbhacks.zingaburga.com/showthread.php?tid=464 and activate it.

Then add this code to postbit/postbit_classic templates:
<if $postcounter == 1 then>
...ad HTML here...
</if>
Reply
#4
Solved: 5 Years, 1 Month, 2 Weeks ago
thanks it worked.
how we can align right within the first post ?
Reply
#5
Solved: 5 Years, 1 Month, 2 Weeks ago
how we can align right within the first post ?
Reply
#6
Solved: 5 Years, 1 Month, 2 Weeks ago
You have to add the adsense div container right above {$post['message']} and also add some inline style into that adsense div.

eg:
..........<snip>
<div class="post_body scaleimages" id="pid_{$post['pid']}">
	<if $postcounter == 1 then>
		<div style="display: inline-block;float: right;padding-left: 10px;">   
		<!--...YOUR ADSENSE SCRIPT...-->
		</div>
	</if>
	{$post['message']}
</div>
<br class="clear" />
<snip>...........
Reply
#7
Solved: 5 Years, 1 Month, 2 Weeks ago
After following your provided code, google ad is coming on right but 

my all replies of posts are not showing ??
Reply
#8
Solved: 5 Years, 1 Month, 2 Weeks ago
It works for me but you could try it without <br class="clear" />.

<div class="post_body scaleimages" id="pid_{$post['pid']}">
    <if $postcounter == 1 then>
        <div style="display: inline-block;float: right;padding-left: 10px;">   
        <!--...YOUR ADSENSE SCRIPT...-->
        </div>
    </if>
    {$post['message']}
</div>

   
Reply
#9
Solved: 5 Years, 1 Month, 2 Weeks ago
tried condtion above but problem is ad is behind the text.  Sad


Attached Files Thumbnail(s)
   
Reply
#10
Solved: 5 Years, 1 Month, 2 Weeks ago
The problem is a css styling of your add script.

Try a change in theme global.css from:
.separator {
margin: 5px;
padding: 0;
height: 0px;
font-size: 1px;
list-style-type: none;
}

to:
.separator {
margin: 5px;
padding: 0;
height: auto;
font-size: 1px;
list-style-type: none;
}
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)