WordPress.org

Ready to get started?Download WordPress

Forums

Plugin for better navigation on pages? (7 posts)

  1. sylla2
    Member
    Posted 8 years ago #

    I found a plugin the other day that'll highlight the current page so that the user will always know what page his on..

    You understand?

    Now I've forgotten where I saw that plugin.. What was the URL? What was the name of it?

    Can anybody help?

    Thanks in advance!

  2. jaredquinn
    Member
    Posted 8 years ago #

    Have you tried searching on http://wp-plugins.net?

  3. niziol
    Member
    Posted 8 years ago #

    What do you mean "current page"? Do you mean the actual WordPress pages? If that's what you mean, as long as your using the wp_list_pages tag, it will add "current_page_item" in the li class, so you need to adjust your stylesheet according to reflect the additional class atribute.

    Cheers,
    Michael.

  4. sylla2
    Member
    Posted 8 years ago #

    Jeredquinn: Yes yes, I searched!

    Niziol: Yes, but if you try several different themes in several different browsers you will notice that it doesn't allways work. Like this theme (in MSIE):

    http://www.lamateporunyogur.net/themesdemo/

    Notice how the "Blog" item in the "page menu" stays white no matter what. Also when active. And I've seen maybe 10 other sites today with various themes where it didn't work either (they could be running earlier versions, of cause).

    Anyhows, that's why this cool dude wrote his plugin. To fix this rather important usability issue.

    Now, I've added some code manually that fixes the problem. However, I'm not confident with that solution. That's why I would like to play it extra safe by also installing the plugin.

    I'm a complete php/css ignorant, mind you :-)

    Best regards!

  5. niziol
    Member
    Posted 8 years ago #

    The buttons do not stay white, the button for the selected page you are on turns blue. The blog item does not change because it is not generated using the wp_list_pages tag.

    I have a quick php code to set the respective atribute on my site, but it will be of little use to you until you learn some CSS basics. There are many tutorials on the codex and on the net, seek those out. You can't make something work until you understand how it works, and only you can learn CSS and whatever else for yourself.

    Good luck.

  6. sylla2
    Member
    Posted 8 years ago #

    Thanks Niziol.. I will and I do..

    The PHP code I've added already does the job. It's probably almost the same code that you’ve got?

    - - - - - - - - - - - - -

    <div id="pages">

      <li <?php if (((is_home()) && !(is_paged())) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) { echo "class=\"current_page_item\""; } ?> >" ><?php _e('Home'); ?><?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>

    </div>

    - - - - - - - - - - - - -

    Was it something like that? I got it from the Regulus theme by Binary Moon (great themes by the way!!!).

    Since it works in all browsers, I'll just go with it. And the plugin I was originally asking' about? Well.. It must have been something I dreamt!!

    LOL :-)

  7. niziol
    Member
    Posted 8 years ago #

    No, I think that will make the "home" button 'light up' when you are on virtually any page, the following is what I use to show the home page as selected.

    <?php
    $pg_li="page_item";
    if (is_home()) {$pg_li .=" current_page_item";}
    ?>
    <ul>
    <li class="<?php echo $pg_li; ?>"><a href="<?php bloginfo('siteurl'); ?>" title="Home">Home</a></li>
    <?php wp_list_pages('depth=1&title_li='); ?>
    </ul>

    You can adjust the statement sfor whatever page you wish to use it on.

    The button not changing colour or what not is nothing to do with PHP or any plugins, it's either missing or wrong in the CSS. So, find a few tutorials on CSS, roll-up your sleeves and dig in!

    Good luck,
    Michael.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.