Go Back   WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 08-11-2011, 11:43 PM   #1
Active Warrior
 
Kamikazee's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
Default How do I put an adsense ad in the middle of my wordpress page?

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.


Kamikazee is offline   Reply With Quote
Old 08-11-2011, 11:54 PM   #2
Tap out your job already
War Room Member
 
vtotheyouknow's Avatar
 
Join Date: Dec 2010
Location: Be sure to wear a flower in your hair
Posts: 376
Thanks: 88
Thanked 98 Times in 63 Posts
Social Networking View Member's Twitter Profile 
Default Re: How do I put an adsense ad in the middle of my wordpress page?

Quote:
Originally Posted by Kamikazee View Post
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.

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

vtotheyouknow is offline   Reply With Quote
Old 08-12-2011, 12:19 AM   #3
Active Warrior
 
Kamikazee's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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?


Kamikazee is offline   Reply With Quote
Old 08-12-2011, 01:12 AM   #4
I Spank Google
War Room Member
 
ExploringInfinity's Avatar
 
Join Date: Oct 2010
Location: SK, Canada
Posts: 501
Thanks: 33
Thanked 84 Times in 59 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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!
-
ExploringInfinity is offline   Reply With Quote
Old 08-12-2011, 01:22 AM   #5
Active Warrior
 
Join Date: Oct 2010
Location: cochin
Posts: 34
Thanks: 1
Thanked 2 Times in 2 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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

leapharris is offline   Reply With Quote
Old 08-12-2011, 01:29 AM   #6
Advanced Warrior
 
StoneWilson's Avatar
 
Join Date: Mar 2011
Posts: 693
Thanks: 69
Thanked 30 Times in 30 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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.

StoneWilson is offline   Reply With Quote
Old 08-12-2011, 02:04 AM   #7
Super Warrior
War Room Member
 
Super Warrior's Avatar
 
Join Date: Aug 2011
Location: FireFox
Posts: 267
Blog Entries: 1
Thanks: 315
Thanked 99 Times in 57 Posts
Social Networking View Member's FaceBook Profile 
Contact Info
Send a message via Yahoo to Super Warrior Send a message via Skype™ to Super Warrior
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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!
Super Warrior is offline   Reply With Quote
Old 08-12-2011, 01:26 PM   #8
Active Warrior
 
Kamikazee's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

Quote:
Originally Posted by Super Warrior View Post
A simple adsense plugin should solve your problem. Did you try 'Why Do Work Adsense' plugin?
Yeah I've tried it and for some reason I cant get it to work. The only one that I could get to work was ad inject and when you refresh the page the adsense is no longer visible but the space is still there.

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.


Kamikazee is offline   Reply With Quote
Old 08-12-2011, 01:52 PM   #9
Senior Warrior Member
War Room Member
 
timpears's Avatar
 
Join Date: Jul 2008
Location: Vancouver, WA, USA.
Posts: 3,500
Thanks: 327
Thanked 584 Times in 408 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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

timpears is offline   Reply With Quote
Old 08-12-2011, 03:16 PM   #10
AdSense Realist
War Room Member
 
JoshuaG's Avatar
 
Join Date: May 2009
Location: Canada
Posts: 751
Thanks: 93
Thanked 99 Times in 76 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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.

JoshuaG is offline   Reply With Quote
Old 08-12-2011, 03:59 PM   #11
Active Warrior
 
Kamikazee's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 88
Thanks: 93
Thanked 2 Times in 2 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

Quote:
Originally Posted by JoshuaG View Post
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.
Josh Thank you a ton for clearing that up. I know the first person told me to do that but I was confused about where to insert the code. You are awesome!!!


Kamikazee is offline   Reply With Quote
Old 08-12-2011, 05:45 PM   #12
AdSense Realist
War Room Member
 
JoshuaG's Avatar
 
Join Date: May 2009
Location: Canada
Posts: 751
Thanks: 93
Thanked 99 Times in 76 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

Quote:
Originally Posted by Kamikazee View Post
Josh Thank you a ton for clearing that up. I know the first person told me to do that but I was confused about where to insert the code. You are awesome!!!
Ha ha thanks bro and np.
If you need a hand with anything else let me know.

JoshuaG is offline   Reply With Quote
Old 08-12-2011, 07:41 PM   #13
Super Warrior
War Room Member
 
imdomination's Avatar
 
Join Date: Oct 2009
Location: AU
Posts: 383
Thanks: 20
Thanked 50 Times in 37 Posts
Social Networking View Member's YouTube Profile
Default Re: How do I put an adsense ad in the middle of my wordpress page?

Quote:
Originally Posted by Kamikazee View Post
Yeah I've tried it and for some reason I cant get it to work. The only one that I could get to work was ad inject and when you refresh the page the adsense is no longer visible but the space is still there.

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.
Did you wait 15 minutes and then refresh your cache? It takes AdSense a while to set up a new ad, and then some themes won't show the ad up until you clear the cache. AdSense Integrator is my personal AdSense plugin of choice.

Glad you got it sorted, anyway.

imdomination is offline   Reply With Quote
Old 08-12-2011, 08:02 PM   #14
Active Warrior
 
daweelmac's Avatar
 
Join Date: Jul 2011
Location: Philippines
Posts: 94
Thanks: 0
Thanked 3 Times in 3 Posts
Social Networking View Member's FaceBook Profile 
Default Re: How do I put an adsense ad in the middle of my wordpress page?

Quote:
Originally Posted by Kamikazee View Post
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?
I think single.php is for individual post/page and not for the homapage. Edit index.php instead.

daweelmac is offline   Reply With Quote
Old 08-13-2011, 06:48 AM   #15
Warrior Member
War Room Member
 
Wixkaz's Avatar
 
Join Date: Aug 2011
Posts: 17
Thanks: 9
Thanked 5 Times in 5 Posts
Default Re: How do I put an adsense ad in the middle of my wordpress page?

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
Wixkaz is offline   Reply With Quote
Old 08-13-2011, 07:34 AM   #16
Banned
 
Join Date: Mar 2011
Location: United Kingdom
Posts: 1,400
Thanks: 17
Thanked 95 Times in 93 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via MSN to simonbuzz Send a message via Yahoo to simonbuzz Send a message via Skype™ to simonbuzz
Default Re: How do I put an adsense ad in the middle of my wordpress page?

WordPress › Advertisement Management « WordPress Plugins with this plugin you can insert ads on almost any place you want...hope that helps
simonbuzz is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum

Tags
adsense, middle, page, put, wordpress

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 09:39 AM.