Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Apply a class to last entry in activity feed

  • How could you determine if an entry is the last item in the activity feed? I need to apply the class “last” to it so I can make the entry stand out using CSS.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Use CSS??!! :) psuedo class :last-child

    Ah yes, of course! Thanks again Hugo!

    you could do things the hard way, using PHP which has no real ‘method’ to get the last item in an array or loop, instead you have to cobble bits together depending on the type of array and it’s a lot more painful.

    I did come up with something to apply a class to every third item in a loop by incrementing a variable on each pass. This was quite straight forward using PHP. Identifying the last item in a loop with PHP isn’t as easy. Your CSS solution was a great shout.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Apply a class to last entry in activity feed’ is closed to new replies.
Skip to toolbar