Community Forums › Forums › Archived Forums › General Discussion › put the code "google adsense"
Tagged: adsense
- This topic has 31 replies, 3 voices, and was last updated 10 years, 11 months ago by Brad Dalton.
-
AuthorPosts
-
March 13, 2013 at 12:16 am #25792tristanMember
How do I put the code "google adsense" in the middle of my wordpress posts? You can go to topsolutionhealth.com to see my theme. Thanks
March 13, 2013 at 2:11 am #25804Brad DaltonParticipantMarch 16, 2013 at 8:56 pm #28410tristanMemberThanks braddalton
March 16, 2013 at 11:34 pm #28449Brad DaltonParticipantHow did these solutions work out for you?
I've also written a post about this with other solutions, one of which is code:
March 29, 2013 at 7:18 am #31900raunekkParticipantwhere to put this code?
Also, how do I wrap text around the code?
Is there a way I can exclude a particular category?
Thanks
Raunek k
March 29, 2013 at 7:19 am #31901raunekkParticipantwhere to put this code?
Also, how do I wrap text around the code?
Is there a way I can exclude a particular category?
March 29, 2013 at 7:31 am #31906Brad DaltonParticipantPaste the code at the end of your child themes functions.php file and add your Google Adsense code to it.
Use a conditional tag
March 29, 2013 at 7:46 am #31912Brad DaltonParticipantMarch 29, 2013 at 12:25 pm #31953raunekkParticipanttried...The ads overlap the content. The content is hidden behind the ads.
Also how do we align it to the left or right?
Thankd
March 29, 2013 at 1:33 pm #31959Brad DaltonParticipantAdd values to the margin property. http://www.w3schools.com/css/css_margin.asp
Code is tested and works.
I didn't test with conditionals because there's hundreds of variables.
Make sure the width of your ads is less than your content area width.
March 29, 2013 at 1:48 pm #31960raunekkParticipantThanks a lot for the quick reply.
I think I got your points!
Also, I tried using conditional tag to prevent ad from showing in posts from a particular category. For that I used the following code:
if ( is_single() || ! in_category( array( 7) ) )
But it still shows in posts from category id=7.
How do I go around with this?
Thanks
Raunek k
March 29, 2013 at 1:56 pm #31963Brad DaltonParticipantMarch 29, 2013 at 1:59 pm #31964raunekkParticipantI used this :
if( !is_single() || !in_category ('7') )
All ads in all categories and posts vanished!
March 29, 2013 at 2:57 pm #31967Brad DaltonParticipantO.k remove it and we'll use CSS to hide Adsense on all posts in a category. its a lot safer!!
March 29, 2013 at 11:29 pm #32020raunekkParticipantCool Brad. I was also looking for a way in which we can align the ad left or right and wrap content around it.
Looking forward..
Thanks a lot
March 30, 2013 at 9:53 am #32085Brad DaltonParticipantTry this:
Or grab the code from Github https://gist.github.com/5277191.git
Align using CSS rules http://www.w3schools.com/tags/att_img_align.asp
March 30, 2013 at 9:55 am #32086Brad DaltonParticipantAlign using CSS http://www.w3schools.com/tags/att_img_align.asp
Exclude Adsense from displaying in posts in one category
https://gist.github.com/5277191.git">https://gist.github.com/5277191.git
https://gist.github.com/5277191
April 27, 2013 at 4:55 am #38031raunekkParticipantHi Brad
Sorry for the late reply.
I tried using the code you provided to prevent ads from showing in posts from one particular category.
But unfortunately it still doesn't seem to work!!
Is it possible for you to reply on this?
Thanks
Raunek
April 27, 2013 at 5:41 am #38033Brad DaltonParticipantCan you please link to the category archive on your site where you say it doesn't work?
All the code i write and provide on these forums is tested.
You can easily change the conditional tags to suit your needs.
Always happy to help!!
April 27, 2013 at 5:50 am #38035raunekkParticipantThanks a lot for the quick reply...
I think there is some confusion on my side.
I am trying to restrict ads from showing in all the posts belonging to a particular category and not in the archive page.
Is the code provided just for the same..?
Sorry if I had been not clear in the first place.
Thanks
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.