Support » Fixing WordPress » Bug? Problem with multiple is_whatever() tests combined with or pipes

  • 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

Viewing 1 replies (of 1 total)
  • I am bewildered by this same problem. Simply makes no sense! Your post helped me get it working at least, but sheesh!

Viewing 1 replies (of 1 total)
  • The topic ‘Bug? Problem with multiple is_whatever() tests combined with or pipes’ is closed to new replies.