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).


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:


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.



More tips

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

Views: 1657

Reply to This

Replies to This Discussion


This week seems to be getting better. We can say tips week. Another great tip. Keep it up SP.

Great tip SP. Am curious if i added a picture on the first right side of the blog right next to the first pragraph, wont this code interfere with it. I mean wont the Ad show on the first main/ front page of the network?

I am surely going to try this tip. It looks great.
It depends if the image is in the first set of para tags. My advice would be to include the image in the first paragraph aligned left or right so the text wraps around it substantially enough for it to look ok once the code gets injected. But this tip doesn't really factor in all the variables possible. All I can suggest is to try it and see how it looks. My guess is that this tip will be best with inline text ads. Let me know how it goes. Sp

SP your code is awesome. I also was on jensocial that AD can be infront of the text. I was wondering if you know how to do that.

With this you dont get a space between the paragraphs.

Found it on thispage http://jensocial.com/group/ningnetworktips/forum/topics/crazy-desig...


did you add the css that I mention above?

Great. It worked.I salute you boss. Enjoy your day.

Great stuff. Pleased it works.

Hi SP,

I saw this from jen and I was wondering if you could combine it with yours so we have one add after the first paragraph and one at the button?


Button or bottom? Either way I'm reluctant to play around with Jen's tip from her site. I'd ask her, especially if you are in her premium group.

Testing <!-- Insert Ads INSIDE Blog Posts by SweetPotato --> with good results. 

I also replace "Continued after the jump ...." which appears in the output for a link to my site. Looks good, too and I have not generated any problem.

I really do not have any idea of what "Continued after the jump ...." means or what is intended to do?

Continued after the jump is oft used language to let readers know that the article or blog will continue after the adverts.


What's Up With Ning 3.0?

Click here to share your thoughts on what features we should develop next! - Survey will close Friday, 4/25

Projects that the Ning 3.0 Team is currently working on: 

Articles - a new way of organizing longer content pieces. Released 4/16.

Activity Feed Updates - options for more content in the activity feed.

Forum Notifications - ability for members to opt into receiving notifications of new discussions in forums. Released 4/9. 

APIs - The ability to create new members and content programatically.

For more information on what's next, visit the Product Roadmap

Latest Activity

Jelena replied to Riccardo Rossini's discussion 'Please Ning staff'
"Same as SE. That would be a problem with the Trademark name.."
1 hour ago
soaringeagle replied to Riccardo Rossini's discussion 'Please Ning staff'
"same on all sites its a bug"
1 hour ago
Jelena replied to Riccardo Rossini's discussion 'Please Ning staff'
"Hi Riccardo I see no navegation on your network"
1 hour ago
Aaron replied to Rainer Glaap's discussion 'Heartbleed, MITM - Security Issues'
"Thanks for bringing this up! As Rainer mentioned, Ning.com wasn't vulnerable to the Heartbleed…"
2 hours ago
Khatlen Guse replied to Stig Karlsen's discussion 'Problems with Facebook activity feed'
"Hi Stig! My feed its ok now! :) I hope that your is ok too."
2 hours ago
soaringeagle replied to Riccardo Rossini's discussion 'Please Ning staff'
"id use that but to be safe make sure theres no copywrite on the pentaprism and if there is it…"
2 hours ago
Riccardo Rossini replied to Riccardo Rossini's discussion 'Please Ning staff'
"I know very well SE, I ensure you that it was a sort of gratitude for the new platform for us. I…"
2 hours ago
Riccardo Rossini replied to Riccardo Rossini's discussion 'Please Ning staff'
"Phil. I take the occasion just to ask you if you took alook at this, for me ot could be e very good…"
3 hours ago

© 2014   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service