WordPress.org

Ready to get started?Download WordPress

Forums

Bug? Problem with multiple is_whatever() tests combined with or pipes (2 posts)

  1. EivindFS
    Member
    Posted 3 years ago #

    Hi there,

    I'm encountering a new and totally bewildering problem.

    On my site, I run this code in my header:
    <?php if( is_home() || is_page($drinkbase_id) || is_page($products_id)) : ?>

    This causes the error message <b>Fatal error</b>: Call to undefined function is_page() in bla bla.

    The fact that there was a space in front of is_page() in the error message got me to try
    <?php if( is_home()||is_page($drinkbase_id)||is_page($products_id)) : ?>

    This works! But I have never before experienced that I cannot have spaces inside logical tests like this. It makes it hard to read my code.

    Is this a WordPress bug? Or is it something unique to my server setup?

    Cheers,
    Eivind

  2. scottmckay
    Member
    Posted 2 years ago #

    I am bewildered by this same problem. Simply makes no sense! Your post helped me get it working at least, but sheesh!

Topic Closed

This topic has been closed to new replies.

About this Topic