• Hi,

    I have the following code:

    if (is_page('50')) {
    										echo '<li class="bold"><a href="https://www.something.com/index1.html">index1.html</a></li>';
    									} else {
    										echo '<li><a href="https://www.something.com/index1.html">index1.html</a></li>';
    									}

    Now all I’m doing is saying if it’s page 50 then add the ‘class=bold’. But there must be a shorter way of doing this?

    Like :

    <li <? if (is_page('50')) { echo 'class="bold"'; }?>><a href="https://www.something.com/index1.html">index1.html</a></li>';

    Would the above work?

    Many thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Quicker way of doing this?’ is closed to new replies.