Hi there!
im having a problem on how to adjust or implement a css style class to the last item in wp_list_pages()
I did manage to add a css style class in order to display a selected item in a list as follows:
an extract from classes.php
extract($args, EXTR_SKIP);
$css_class = 'page_item page-item-'.$page->ID;
if ( !empty($current_page) ) {
$_current_page = get_page( $current_page );
if ( in_array($page->ID, (array) $_current_page->ancestors) )
$css_class .= ' current_page_ancestor';
if ( $page->ID == $current_page )
$css_class .= ' active'; <---- I CHANGED THIS TO ACTIVE
elseif ( $_current_page && $page->ID == $_current_page->post_parent )
$css_class .= ' current_page_parent';
}
However my problem is I dont know how to add another class for the last item only. it should render something like as follows
...<li class="page_item page-item-1 ACTIVE">Page 1...
...<li class="page_item page-item-2">Page 2...
...<li class="page_item page-item-3">Page 3...
...<li class="page_item page-item-4 LAST">Page 4...
So i dont know where in the wp code to add the class 'last'
I would be grateful for any help
Thank you.
Jim