• Resolved Brigitte

    (@brigitte)


    I noticed in the Blix theme that when the page was selected it was highlighted. I’m using my own theme and I have already incorporated all the css but I don’t know the code to make it so that a page does become highlighted. Any help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Brigitte

    (@brigitte)

    Thanks Moshu . . . that would help me for any regular site, but I don’t want to manually add a tag to each page. I want all of the pages to just automatically show up. The first link you gave me is telling me to link the pages and add some php to it. Like the Blix theme, any and all pages will automatically become listed. This is the code:


    <ul>
    <li<?php if (is_home()) echo " class=\"selected\""; ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php
    $pages = BX_get_pages();
    if ($pages) {
    foreach ($pages as $page) {
    $page_id = $page->ID;
    $page_title = $page->post_title;
    $page_name = $page->post_name;
    if ($page_name == "archives") {
    (is_page($page_id) || is_archive() || is_search() || is_single())?$selected = ' class="selected"':$selected='';
    echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">Archives</a></li>n";
    }
    elseif($page_name == "about") {
    (is_page($page_id))?$selected = ' class="selected"':$selected='';
    echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">About</a></li>n";
    }
    elseif ($page_name == "contact") {
    (is_page($page_id))?$selected = ' class="selected"':$selected='';
    echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">Contact</a></li>n";
    }
    elseif ($page_name == "about_short") {/*ignore*/}
    else {
    (is_page($page_id))?$selected = ' class="selected"':$selected='';
    echo "<li".$selected."><a href=\"".get_page_link($page_id)."\">$page_title</a></li>n";
    }
    }
    }
    ?>
    </ul>

    I’ve made my css so that it will work with ul and li, but what part of this do I need to keep?

    I am not interested in blix code. If your theme is a clone of blix and using blix code, sorry, I can’t help.
    The second link I gave it explains what class should you style.

    Thread Starter Brigitte

    (@brigitte)

    OOOOH. Hahah, it just took me a little time to figure it out. Thanks very much moshu! I did it without the whole Blix code. I just changed the class style in my css to current_page_item and whatnot. Thanks!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Making Selected Pages Highlighted’ is closed to new replies.