WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using "not" with conditional tags (8 posts)

  1. Kathy_P
    Member
    Posted 8 years ago #

    Is there a way to use "not" with conditional tags? For example, in my sidebar template I would like to display a Google ad modules for all pages except a 404. Is there a way to say "If this page is not a 404, then execute this Google code"? Or is there a better way to go about it?

  2. jaredquinn
    Member
    Posted 8 years ago #

    Something like:

    <?php
    if(!is_404()) {
    adsense_deluxe_ads();
    }
    ?>

    (assuming you're using Adsense deluxe for your Google ads)

  3. moshu
    Member
    Posted 8 years ago #

    "em" works - "i" doesn't :)

  4. jaredquinn
    Member
    Posted 8 years ago #

    Ooops :) fixed.

  5. Kathy_P
    Member
    Posted 8 years ago #

    So, you are saying that using an exclamation point means "not" in php? That was what I needed to know. And I am not familiar with Adsense deluxe--is that a plugin? I've just been pasting in the code that Google gives me.

  6. vkaryl
    Member
    Posted 8 years ago #

    Good questions. I did know about the ! = not, but moi aussi, I would like the answer to the other....

  7. moshu
    Member
    Posted 8 years ago #

    It's a plugin: http://www.acmetech.com/blog/2005/07/26/adsense-deluxe-wordpress-plugin/
    The Codex is down again, but you can also find the link to it in Plugins/Advertisment

  8. vkaryl
    Member
    Posted 8 years ago #

    Ah, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic