• Resolved lleger

    (@lleger)


    I have a pure css menu at the header of my blog and am trying to get it to highlight the current page with the css class “current”. I have the code:

    <li><?php if is_page() echo class="active" ?></li>
    I thought that this would work but it spits out this ugly error:Parse error: parse error, unexpected T_STRING, expecting ‘(‘ in …..

    Any ideas? Did I code it wrong? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Kafkaesqui

    (@kafkaesqui)

    <li <?php if(is_page()) echo 'class="active"'; ?>></li>

    Always quote your strings in a PHP echo.

    Thread Starter lleger

    (@lleger)

    Oh. Right, thanks for spotting my error. This fixes the problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Current Page’ is closed to new replies.