Grow your CSS skills. Land your dream job.

[Solved] Adding Classes to Individual List Items Dynamic

  • # January 5, 2010 at 12:22 pm

    Okay. Here’s what I’m trying to do. this is a wordpress question

    I have a navigation that is being dynamically generated by word press function list_pages & list_categories. Becuase of this I can assign a styling to the UL or LI that gets dynamically generated. HOWEVER, I’m trying to create indivual rollover graphics for each List item created. How do I assign classes to specific dynamically generated (li) items?

    Look at how I created the navigation located on the top. They are hardcoded in the sidebar.php page. I want a similar effect happening to the lower navigation on the page that is being dynamically generated. thanks!

    http://www.photodelphia.org/lightupandlisten/

    # January 5, 2010 at 12:29 pm

    uhhhhggg,

    I think I just figured it out. Thanks to firebug I was able to see that a class gets created for each list_pages and List_cat

    ie: class=" cat-item cat-item-5"

    I’ll just style those generated classes.

    # January 5, 2010 at 1:01 pm

    Indeed…and just so you know, there is a plugin that will append ‘first’ and ‘last’ class to the respective LI’s.

    http://wordpress.org/extend/plugins/cla … ist-pages/

    There is also a way to generate "even" and "odd" when it comes to posts.

    Btw, if you fixed the problem, edit your topic to say [SOLVED] so other users know. :mrgreen:

    # January 5, 2010 at 1:50 pm

    word. thanks for the plugin link!!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".