Glossary layout lists by second word (last name, surname)

Content Views Pro helps you to show posts in glossary layout like this easily.
In case your post title is person name, you might want to list people by their surname (last name). To do that, please add this code to file functions.php of your active theme:

// CVPro - Glossary index by last name (surname)
add_filter( 'pt_cv_glossary_key', 'cvp_theme_glossary_key_change', 100, 2 );
function cvp_theme_glossary_key_change( $args, $title ) {
	global $pt_cv_id;
	if ( $pt_cv_id === 'VIEW_ID' ) {
		$next_word	 = substr( $title, (int) strpos( $title, ' ' ) + 1 );
		$args		 = substr( $next_word, 0, 1 );

	return $args;

(Please replace VIEW_ID with ID of your View)

Best regards,