• Resolved andyspeed

    (@andyspeed)


    Hi all. I wonder if anyone has an intuitive solution to my problem. I have two themes for my site – one is white, and the other is black. I placed my Ads in php files that are included where necessary.

    The adverts are white.

    However, when a user switches theme to the black one, the ads obviously stay white.

    Is there a way I can call one php file (containing one style of ad) if a certain template is used, and call another php file containing the other ad style when the other template is used?

    Andy

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter andyspeed

    (@andyspeed)

    Lol I was about to say…

    the plus sign screws it up.

    1. rename the fast lane theme. do that by editing the top of the style.css where is says “Theme Name: ..” Call it fastlane, anything as long as its 1 word.

    Then do this, Put this in your footer somewhere, out of view of the normal user unless they scroll:

    <?php
    if($_COOKIE["wptheme".COOKIEHASH] == "Classic")
    { echo "theme is classic"; }
    else if($_COOKIE["wptheme".COOKIEHASH] == "Fastlane")
    { echo "theme is fastlane"; }
    else
    { echo "its not working"; } //broke
    ?>

    Once you see thats working, you can adjust that to do what you want like I explained above.

    This worked for me on my sandbox.

    and oddly, I dont know why the plus sign breaks it, its there in ie’s cookie too. Ah well.

    Thread Starter andyspeed

    (@andyspeed)

    Thanks very much whooami. I’ve managed to make this work now.

    How shall I credit you on my credits page of my site?

    haha dont worry about credits.. its not that a big of a deal ?? but thanks!

    Heya, AndySpeed, wanna mark this resolved then? Thanks! Whoo, that’s a great example of thinking through a problem…. thanks – bet it comes in handy eventually, and I’ve copied the whole thread to a file….

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Adsense/Theme switcher issue’ is closed to new replies.