This code displays the last term added to a taxonomy "issue" which i use to automatically display a link toward my current issue:
$args = array( 'hide_empty=0' );
$terms = get_terms( 'issue', 'orderby=id&order=DESC&number=1' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
$count = count( $terms );
$i = 0;
$term_list = '<p class="arc">';
foreach ( $terms as $term ) {
$i++;
$term_list .= '<a href="' . get_term_link( $term ) . '" title="' . sprintf( __( 'View all post filed under %s', 'my_localization_domain' ), $term->name ) . '">(' . $term->name . ')</a>';
if ( $count != $i ) {
$term_list .= ' </p> ';
}
else {
$term_list .= '';
}
}
echo $term_list;
}
I need to display the term before the last to show automatically the link of previous issue of my publications. Any suggestions please?