php quandary in sidebar ($single post?) (3 posts)

  1. MrFlora
    Posted 10 years ago #

    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:

    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


  2. Kafkaesqui

    Posted 10 years ago #


    <?php if (!is_single()) { ?>
    (ad unit code)
    <?php } ?>

  3. MrFlora
    Posted 10 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic