put the code "google adsense"

Community Forums Forums General Discussion put the code "google adsense"

This topic is: not resolved

Tagged: 

This topic contains 31 replies, has 3 voices, and was last updated by  braddalton 1 year, 9 months ago.

Viewing 15 posts - 1 through 15 (of 32 total)
  • Author
    Posts
  • #25792

    tristan
    Participant

    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

    #25804

    braddalton
    Participant
    #28410

    tristan
    Participant

    Thanks braddalton

    #28449

    braddalton
    Participant

    How did these solutions work out for you?

    I’ve also written a post about this with other solutions, one of which is code:

     


    #31900

    raunekk
    Participant

    where 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

    #31901

    raunekk
    Participant

    where to put this code?

    Also, how do I wrap text around the code?

    Is there a way I can exclude a particular category?

     

    #31906

    braddalton
    Participant

    Paste the code at the end of your child themes functions.php file and add your Google Adsense code to it.

    Use a conditional tag


    #31912

    braddalton
    Participant

    You’ll need to add it with this line

    if( !is_single() )
    

    #31953

    raunekk
    Participant

    tried…The ads overlap the content. The content is hidden behind the ads.

     

    Also how do we align it to the left or right?

     

    Thankd

    #31959

    braddalton
    Participant

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


    #31960

    raunekk
    Participant

    Thanks 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

     

     

    #31963

    braddalton
    Participant

    Try !in_category (‘7′)


    #31964

    raunekk
    Participant

    I used this :

     

    if( !is_single() || !in_category (‘7′) )

     

    All ads in all categories and posts vanished!

     

    #31967

    braddalton
    Participant

    O.k remove it and we’ll use CSS to hide Adsense on all posts in a category. its a lot safer!!


    #32020

    raunekk
    Participant

    Cool 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

Viewing 15 posts - 1 through 15 (of 32 total)

You must be logged in to reply to this topic.