Support » Fixing WordPress » Error when using the if (is_page()) sintax

  • Hello guys. I have a small problem. I want to show something in my wordpress sidebar on a specific page. In the sidebar.php I try to insert something like :

    <?php if (is_page(7)) { something here } else { } ?>

    But it gives me the following error :

    Parse error: syntax error, unexpected T_STRING in

    What am I doing wrong ? Can you please help me out ? Tks a lot in advance.

    Razvan

Viewing 1 replies (of 1 total)
  • 1.) Try <?php if (is_page('7'))
    2.) Get rid of the empty else

    If that doesn’t work, then you need to post your entire code that you’re trying to use.

Viewing 1 replies (of 1 total)
  • The topic ‘Error when using the if (is_page()) sintax’ is closed to new replies.