Forums

Quicker way of doing this? (4 posts)

  1. sincewelastspoke
    Member
    Posted 3 years ago #

    Hi,

    I have the following code:

    if (is_page('50')) {
    										echo '<li class="bold"><a href="http://www.something.com/index1.html">index1.html</a></li>';
    									} else {
    										echo '<li><a href="http://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="http://www.something.com/index1.html">index1.html</a></li>';

    Would the above work?

    Many thanks for your help.

  2. sincewelastspoke
    Member
    Posted 3 years ago #

    Anyone? Bueller?

  3. sincewelastspoke
    Member
    Posted 3 years ago #

    Anyone?

    Would really appreciate help on this.

  4. Xamataca
    Member
    Posted 3 years ago #

    why not try it first before asking for help?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.