Error when using the if (is_page()) sintax (2 posts)

  1. angelro
    Posted 8 years ago #

    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.


  2. fitztrev
    Posted 8 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic