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, 3 months ago.

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

    tristan
    Participant
    Post count: 1

    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
    Post count: 8876
    #28410

    tristan
    Participant
    Post count: 1

    Thanks braddalton

    #28449

    braddalton
    Participant
    Post count: 8876

    How did these solutions work out for you?

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

     


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #31900

    raunekk
    Participant
    Post count: 40

    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
    Post count: 40

    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
    Post count: 8876

    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


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #31912

    braddalton
    Participant
    Post count: 8876

    You’ll need to add it with this line
    [php]
    if( !is_single() )
    [/php]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #31953

    raunekk
    Participant
    Post count: 40

    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
    Post count: 8876

    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.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #31960

    raunekk
    Participant
    Post count: 40

    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
    Post count: 8876

    Try !in_category (’7′)


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #31964

    raunekk
    Participant
    Post count: 40

    I used this :

     

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

     

    All ads in all categories and posts vanished!

     

    #31967

    braddalton
    Participant
    Post count: 8876

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


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #32020

    raunekk
    Participant
    Post count: 40

    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.