I am trying to get the last entry in a foreach loop but struggling so far. My biggest problem is that once inside the foreach loop, I need to filter the array by eliminating every author who has 0 posts. This is my code so far:
$authors = get_users('orderby=nicename');
foreach ($authors as $author ) {
if ( count_user_posts( $author->id ) >= 1 ) { IF LAST {special <li>} else {normal <li> }
Can anyone shed some light on how to get the last entry in this scenario? Thanks