• Resolved jdcpar5

    (@jdcpar5)


    Trying to use an if statement for when is_home() is false, i.e. any page other than page(‘home’).

    Can someone please help with the correct syntax?

    Trying to say:

    <?php if (is_home() = false) echo('whatever...

    I would REALLY appreciate any help.

    Sorry for the dumb noob question.

    Jeff

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Use double equals for equality comparison. Single equals are for assignment.

    <?php if (is_home() == false) echo('whatever...

    Alternatively:
    <?php if (!is_home()) echo('whatever...

    The ! is for negation.

    Thread Starter jdcpar5

    (@jdcpar5)

    THANK YOU!

    I saw the != operator, but wasn’t sure if I could use !is-home()

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Newbie PHP Syntax is_home() = false’ is closed to new replies.