[resolved] PHP operators - how to do something if it's not this OR this... (3 posts)

  1. vikkineal
    Posted 3 years ago #

    Can anyone advise what i'm doing wrong here?

    I'm trying to load a jQuery function IF the page isn't using a template OR if it's not a single OR if it's not an archive.

    I have the below...

    <?php if ( ! is_page_template('modelPages.php') || ! is_archive() || ! is_single ) { ?>

    But it doesn't seem to work... HOWEVER if I remove the or operators and subsequent rules, the function doesn't load (which is correct) on the modelPage.php templates.

    How should i be writing this rule?



  2. Michael
    Part-Time Forum Moderator
    Posted 3 years ago #

    <?php if ( ! is_page_template('modelPages.php') && ! is_archive() && ! is_single() ) { ?>

    if it is none of those...

    btw: is_single was mising the brackets.

  3. vikkineal
    Posted 3 years ago #

    Ah I see! Thank you - that worked great.

Topic Closed

This topic has been closed to new replies.

About this Topic