Hi,
I am not using the “standard” layout to display custom post types (not the masonry layout).
Due to the small space constraints most author names takes 2 lines.
Instead of showing the full name, how can I display only the First Name and initial (first letter) of the last name?
I’ve tried to edit my archive-customposttype.php to implement this
COPY CODE
<?php echo the_author_meta('first_name'); ?>
<?php echo (' '); ?>
<?php echo substr(get_the_author_meta('last_name'),0,1).'.'; ?>
but the code is quite tricky calling for a specific class:
COPY CODE
<?php
//Specific class for post listing
$blog_type = sq_option('blog_type','masonry');
$blog_type = apply_filters( 'kleo_blog_type', $blog_type );
$template_classes = $blog_type . '-listing';
if ( sq_option( 'blog_meta_status', 1 ) == 1 ) {
$template_classes .= ' with-meta';
} else {
$template_classes .= ' no-meta';
}
if ( $blog_type == 'standard' && sq_option('blog_standard_meta', 'left' ) == 'inline' ) {
$template_classes .= ' inline-meta';
}
add_filter('kleo_main_template_classes', create_function('$cls','$cls .=" posts-listing ' . $template_classes . '"; return $cls;'));
?>
How can I change these author meta or implement my above snippet to display the last name’s initial only?