How to add a “last” class to the last post in loop.php?

I need to add a “last” class to the last post that appears in loop.php.

Can someone tell me how to accomplish this?

Related posts

Leave a Reply

2 comments

  1. I am using jQuery addClass() when I style odd/even list items or similar. You could probably use it to achieve what you want too.

    Example:

     $("#menu_side > ul > li:last-child").addClass("last");