Hi

This is a simple yet potentially lucrative tip to insert Google Adsense or Yahoo/Bing Ads (or anything really) after the first paragraph (defined by <p> tags) in all content in forum or blog posts (including member posts).

ADS IN BLOGS:

Click to enlarge preview
Here is the script to insert adverts under the first paragraph in BLOG POSTS. The red script will need to be replaced with your own Google Adsense or Yahoo/Bing ads script.

Put it in your custom code box:

<!-- Insert Ads INSIDE Blog Posts by SweetPotato -->
<div id="ad_after_jump" style="display:none;">
<!-- Advert Script START -->
<script id="mNCC" language="javascript">  medianet_width='200';  medianet_height= '200';  medianet_crid='45454545';  </script>  <script id="mNSC" src="http://contextual.media.net/nmedianet.js?cid=4545454" language="javascript"></script>
<!-- Advert Code END -->
</div><script type="text/javascript">if (typeof(x$) != 'undefined') {  x$('.xg_widget_profiles_blog_show .postbody .xg_user_generated').find('p').eq(0).after('<p style="font-weight:bold;">Continued after the jump ....</p></br><div id="ContentAdverts"></div>');    var inject_SPadverts = document.getElementById('ad_after_jump');    var SPadverts = document.getElementById('ContentAdverts');    SPadverts.innerHTML = inject_SPadverts.innerHTML; }</script>

 

ADS IN FORUM POSTS - same as above but use this code and change the red script.

<!-- Insert Ads INSIDE Forum Posts by SweetPotato -->
<div id="ad_after_jump" style="display:none;">
<!-- Advert Script START -->
<script id="mNCC" language="javascript"> medianet_width='200'; medianet_height= '200'; medianet_crid='54565767'; </script> <script id="mNSC" src="http://contextual.media.net/nmedianet.js?cid=84534343" language="javascript"></script>
<!-- Advert Code END -->
</div><script type="text/javascript">if (typeof(x$) != 'undefined') { x$('.xg_widget_forum_topic_show .description .xg_user_generated').find('p').eq(0).after('<p style="font-weight:bold;">Continued after the jump ....</p></br><div id="ContentAdverts"></div>'); var inject_SPadverts = document.getElementById('ad_after_jump'); var SPadverts = document.getElementById('ContentAdverts'); SPadverts.innerHTML = inject_SPadverts.innerHTML; }</script>


I have tested this pretty thoroughly and only come across a couple of instances where the ads weren't where I expected them to be. 95% of the time they are after the first paragraph, assuming that the html generated in the content has the correct <P>tags.

If your ads are not going to fill the width of the page, for example if they are 200px wide, and you want the following paragraph to wrap around the advert then add this css to your advanced css section:

#ContentAdverts{
width:220px;
float:left;
margin-right:15px;
}

If you want to remove the 'Continued after the jump wording then delete <p style="font-weight:bold;">Continued after the jump ....</p></br> from the code above.

Play around with it and see how you get along.

Enjoy

SP

More tips

Tags: , Insert, , , Paragraph, , Paragraph, Paragraph, Adverts, Adverts inside Blogs, Forum", Insert Adverts in Content after the First Paragraph, Paragraph, Paragraph", inside

Views: 916

Reply to This

Replies to This Discussion

I have no way of testing yet <!-- Insert Ads INSIDE Forum Posts by SweetPotato --> since I am moving my PLus Site into a Mini, in order to make the Mini a PLUS Site and get rid of the old one. I do not planned to spend twice.

I will let you know how it looks <!-- Insert Ads INSIDE Forum Posts by SweetPotato --> in the new site. 

The Mini will change into PLUS when I reach 140 and 2 days before invoicing on the old I will get rid of it.

Good luck with it all
Sp

SP, I tried it out and it is working great. Would you know how to append an ad to the bottom of a video? For example, in the space you would use to add descriptive material about a video?

hey that is a very nice tip!

please do have a code that makes advert on forum/blog appearing at the bottom of the first post rather than after the first paragraph?

thanks

thanks for the link

when i placed the code as it is on the page - i got the text in in the right position but when i replaced the text with adsense code (to have advert appearing ) it didnt work :S

thanks but that is only for forums - i want the code for blog posts

oh thanks a lot!!! that was very nice of you!

i placed both forum and blog codes in my custom code page

Blog google adverts are appearing okay but forum google adverts only appear if i remove the code for the Blog - seems there is a conflict


anyone else encountered this problem?

Thanks a lot SweetPotato, working fine on Blogs and Discussions.

I want to use the same on pages too as my network is content based and pages are most important. Please suggest........

http://thatsme.in

RSS

Latest Activity

Lady Panter favorited Rafael's group Ning Networks en español
1 hour ago
Dustin Craig replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
"Thanks!"
2 hours ago
Dustin Craig replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
"Let me send you a friend request so I can message you rather than take this thread more off-topic."
2 hours ago
Paul Corona replied to Suzie Nielsen's discussion 'Watching Cultivating videos- have questions!'
"So many folks were asking the same questions that I thought actually showing them the basics of the…"
4 hours ago
Chris replied to JFarrow's discussion 'Ning Emails Going to Spam?'
"Nope, had all the answers: "it's not a bug", "it is a bug and has been…"
5 hours ago
Larry Matthews replied to Larry Matthews's discussion 'Photos'
"www.dismyhood.com I need to enlarge images on mouseover, on the activity feeds. There is a feed for…"
5 hours ago
Fabio replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"F A N T A S T I C !!!!! well done guys"
6 hours ago

NC for Hire
Jen replied to Jen's discussion 'Jen's Running List - Updated 4/6/2013' in the group The Sandbox
"Hi Allison, I have a Client who needs the Search feature. Any updates? I don't see any Search…"
6 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service