• I’m trying to place an ad unit in my sidebar that will not display when in single post view. I’ve tried setting up something like this:

    <?php
    if ($single) { ?>
    <?php } else { ?>
    (ad unit code)
    <?php } ?>

    I was thinking that when it was in single post view, nothing would show, and when it was in any other view, the ad would show.

    Its not working though. I’m starting to think that the problem is that whatever signal tells the system that you’re in single post view is closed before the sidebar is even placed so the if/else stuff isn’t even being activated.

    What do I need to add to my sideabar for it to be able to determine if I’m in single view or not?

    If you haven’t guessed I’m a php noob.

    you can check out my blog at http://www.goculver.com

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php quandary in sidebar ($single post?)’ is closed to new replies.