Support » Themes and Templates » Lesson: Rollover Links

Viewing 8 replies - 1 through 8 (of 8 total)
  • One of the challenges that I would love to see, and I know it is asking a lot but I’m sure it can be done, is to have the categories highlighted when you are in that category.

    How would that be done in WordPress? Anyone?

    How do you mean Lorelle, can you describe what you’re trying to achieve?

    In CSS 2 any element can be hovered. Doesnt work in Ie of course. Could be cool but from the accessibility / expectation standpoint it would be very different and suprising to the user. Still all you need do is identify the cat selector and off you go.

    And how do you do you add the category selector to the content? I think lorelle sor tof explains it, but you have the styling for your category, but how do you apply to each individual category and where do you apply it?

    Well the cat selector is in the content already with a dynamically produced id. To my knowledge it is not in the CSS but is easy to add. Apply in style.css in the usual way. Is this link cats you are interested in or post cats ?. Both can be fixed up .Just clarify what you need and I will post the code.

    Okay, this is the clarification. With CSS, you can set the styles in a menu, categories in this example. So we have a list that says (without the php for now):

    <div class="nav">
    <ul><li><a href="fred.php">Fred</a></li>
    <li class="active"><a href="alice.php">Alice</a></li>
    <li><a href="sally.php">Sally</a></li>

    When you are styling CSS in static html, you can manually add class="active" to any specific LI item. The style “active” highlights that list item different than the other items in the list. This way we would automatically know that we are reading a post in the Alice category.

    What is being requested (by others, not just me) is a way to set the class="active" based upon the category because we aren’t creating static pages now but dynamic pages. So there needs to be some kind of a php code that says:

    IF category=1, then $active = "active", IF category=2, then $active = "active"....ELSE no nothing.

    And then the list would look something like this (I don’t know PHP very well so I’m faking it for clarification):

    <div class="nav">
    <li class="<?php $active ?>"><a href="fred.php">Fred</a></li>
    <li class="<?php $active ?>"><a href="alice.php">Alice</a></li>
    <li class="<?php $active ?>"><a href="sally.php">Sally</a></li>

    If the code worked, $active would become active if the category was being visited at that time.

    Does this make sense?

    I’m also missing the ‘ class=”selected” ‘ -functionality for list_pages()… Any news on this one?

    There currently is no such feature on this.

    Maybe soon.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Lesson: Rollover Links’ is closed to new replies.