![]() | | ||||||||
| | #1 |
| Active Warrior Join Date: Nov 2010 Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
|
I have been searching the internet for sometime now and can't seem to find out how you ad an adsense add to the middle of your page. Here's an example of what I'm talking about. I've seen a bunch of other sites doing this as well, and was wondering if there was a tutorial or step by step guide someone could point me to. Thanks. |
| | |
| | |
| | #2 | |
| Tap out your job already War Room Member Join Date: Dec 2010 Location: Be sure to wear a flower in your hair
Posts: 376
Thanks: 88
Thanked 98 Times in 63 Posts
| Quote:
Use: <div style="float:right">Adsense Code</div> if you want the adsense ad on the right with text wrapping around it on the left and use float:left if you want the ad on the left. If that detox site is yours, you might want to throw up a privacy policy before Big G bizzle slaps your account! BTW, your lens looks hella good man :-) Good luck! Vic | |
| | ||
| | |
| | #3 |
| Active Warrior Join Date: Nov 2010 Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
|
Thanks for that man. If I wanted it just to show up on my main homepage only, would I put it in after the <div class="entry"> line on the single.php?
|
| | |
| | |
| | #4 |
| I Spank Google War Room Member Join Date: Oct 2010 Location: SK, Canada
Posts: 501
Thanks: 33
Thanked 84 Times in 59 Posts
|
you can also use a plugin called 'whydoworkadsense' which has many customizable options for ways to display adsense or other ad types in your pages. Check it out if you want, that's what I use. |
| - A Link Building Service That Works Automated Backlink Networks For A Reasonable Price... Don't Miss Out! - | |
| | |
| | #5 |
| Active Warrior Join Date: Oct 2010 Location: cochin
Posts: 34
Thanks: 1
Thanked 2 Times in 2 Posts
|
Hi, For inject AdSense unit in the middle of post you need to open “functions.php” inside your theme folder. Now insert this code on on starting of file but after php start tag. function inject_ad_text_after_n_chars($content) { // only do this if post is longer than 1000 characters $enable_length = 2000; // insert after the first </p> after 500 characters $after_character = 1500; if (is_single() && strlen($content) > $enable_length) { $before_content = substr($content, 0, $after_character); $after_content = substr($content, $after_character); $after_content = explode(‘</p>’, $after_content); $text = ‘ <!——AdSense Code here———-> ‘; array_splice($after_content, 1, 0, $text); $after_content = implode(‘</p>’, $after_content); return $before_content . $after_content; } else { return $content; } } add_filter(‘the_content’, ‘inject_ad_text_after_n_chars’); In this code you can see one yellow point just replace it with your AdSense unit and save your file back in theme folder. Put AdSense in the Middle of Posts in Wordpress How to Add Adsense code middle of the wordpress post content | SEO Hyderabad |
| | |
| | |
| | #6 |
| Advanced Warrior Join Date: Mar 2011
Posts: 693
Thanks: 69
Thanked 30 Times in 30 Posts
|
Nope, for homepage you need to add it into index.php instead. Actually there are lots of plugins can help you add Adsense ads in the posts if you are using Wordpress, you can find them on wp official website.
|
| | |
| | |
| | #7 |
| Super Warrior War Room Member Join Date: Aug 2011 Location: FireFox
Posts: 267
Blog Entries: 1 Thanks: 315
Thanked 99 Times in 57 Posts
|
A simple adsense plugin should solve your problem. Did you try 'Why Do Work Adsense' plugin?
|
| Goals are the fuel in the furnace of achievement! | |
| | |
| | #8 | |
| Active Warrior Join Date: Nov 2010 Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
| Quote:
The plug in is messed. I can place it once anywhere and have the ad show up, but as soon as the page is refreshed it goes blank. I'm trial and erroring some plugins right now. Its really frustrating. | |
| | ||
| | |
| | #9 |
| Senior Warrior Member War Room Member Join Date: Jul 2008 Location: Vancouver, WA, USA.
Posts: 3,500
Thanks: 327
Thanked 584 Times in 408 Posts
|
For Wordpress I recommend using Whydowork plugin. You can put the ads in various positions and on only the pages you want them to appear on. |
|
Tim Pears | |
| | |
| | #10 |
| AdSense Realist War Room Member Join Date: May 2009 Location: Canada
Posts: 751
Thanks: 93
Thanked 99 Times in 76 Posts
|
Man, these people are making things way more confusing for you then they need to be. Forget all the plug-ins and PHP file editing. If you want to display that ad unit only on your homepage do this: 1 - Open the post/page in your wordpress editor. 2 - Click the HTML tab above the content box (its on visual editor by default) 3 - Use <div style="float:right">Adsense Code</div> as the first guy suggested. DONE. |
| | |
| | |
| | #11 | |
| Active Warrior Join Date: Nov 2010 Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
| Quote:
| |
| | ||
| | |
| | #12 |
| AdSense Realist War Room Member Join Date: May 2009 Location: Canada
Posts: 751
Thanks: 93
Thanked 99 Times in 76 Posts
| |
| | |
| | |
| | #13 | |
| Super Warrior War Room Member Join Date: Oct 2009 Location: AU
Posts: 383
Thanks: 20
Thanked 50 Times in 37 Posts
| Quote:
Glad you got it sorted, anyway. | |
| | ||
| | |
| | #14 |
| Active Warrior Join Date: Jul 2011 Location: Philippines
Posts: 94
Thanks: 0
Thanked 3 Times in 3 Posts
| |
| | |
| | |
| | #15 |
| Warrior Member War Room Member Join Date: Aug 2011
Posts: 17
Thanks: 9
Thanked 5 Times in 5 Posts
|
This is really cool. I used the <div style="float:right">Adsense Code</div> to put an amazon affiliate banner ad into a post. I had to add a margin so that it didnt look so crowded: <div style="margin:10px; float:right">Amazon Code</div> Thanks for this very useful post and all the replies, Keith |
| | |
| | #16 |
| Banned Join Date: Mar 2011 Location: United Kingdom
Posts: 1,400
Thanks: 17
Thanked 95 Times in 93 Posts
| WordPress › Advertisement Management « WordPress Plugins with this plugin you can insert ads on almost any place you want...hope that helps
|
| | |
![]() |
|
| Tags |
| adsense, middle, page, put, wordpress |
| Thread Tools | |
| |
![]() |