• Hi,

    I have a sidebar for a page with links within the ‘Services’ section.

    So basically everything that is a sub-page of page 15 is shown there. <?php wp_list_pages('sort_column=menu_order&title_li=&child_of=15'); ?>
    More importantly, I want to stick in the <strong> tags if they’re on that very page.

    Anyone know of this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can we see what you’re talking about?

    It might be that you need to add in some CSS, but I can’t say for sure.

    Thread Starter sincewelastspoke

    (@sincewelastspoke)

    Sorry, it’s held locally, would prefer not to upload for now heh. Hope that’s OK.

    Uhm, basically if I’m in the FOOTBALL page I’d like it to be like

    > Rugby
    > Cricket
    > Football
    > Formula 1

    I’d assumed you could just add &class=bold to that.

    Is this possible, without having to do a stack of if statements?

    Thread Starter sincewelastspoke

    (@sincewelastspoke)

    Anyone?

    I would do something like this:

    // in the PHP
    <?php
    if(page_id==14) {
    $rugbyLink="";
    $cricketLink="activeSideBarLink";
    $footballLink="";
    $formula1Link="";
    }
    else if(page_id==15) {
    $rugbyLink="";
    $cricketLink="";
    $footballLink="activeSideBarLink";
    $formula1Link="";
    }
    // include else if statements for all possibilities and end with
    else {
    $rugbyLink="";
    $cricketLink="";
    $footballLink="";
    $formula1Link="";
    }
    ?>
    <!-- in the HTML -->
    <li class="$rugbyLink"><a href="yourLinkHere">Rugby</a></li>
    <li class="$cricketLink"><a href="yourLinkHere">Cricket</a></li>
    <li class="$footballLink"><a href="yourLinkHere">Football</a></li>
    <li class="$formula1Link"><a href="yourLinkHere">Formula 1</a></li>
    <!-- etc -->
    /* in the CSS */
    .activeSideBarLink a, .activeSideBarLink a:link, .activeSideBarLink a:visited, .activeSideBarLink a:hover {
    font-weight: bold !important;
    }

    HTH

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing link style if on that page, highlight/bold text’ is closed to new replies.