Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Created February 20, 2017 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helgatheviking/9c205b3e8f725c4d99afcde81c701a36 to your computer and use it in GitHub Desktop.
Save helgatheviking/9c205b3e8f725c4d99afcde81c701a36 to your computer and use it in GitHub Desktop.
.author-search {
margin-bottom: 1.625em;
}
.author-block {
float: none;
display: block;
}
.author-block ul {
list-style: none;
}
<?php
/**
* The Template for displaying Author listings
*
* Override this template by copying it to yourtheme/authors/content-author.php
*
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $user;
$user_info = get_userdata( $user->ID );
$num_posts = count_user_posts( $user->ID );
?>
<div id="user-<?php echo $user->ID; ?>" class="author-block">
<ul>
<?php if( $user_info->last_name && $user_info->first_name) : ?>
<li><?php printf( _x( '%s, %s', 'Last Name, First Name', 'your-theme-textdomain' ), $user_info->last_name, $user_info->first_name ); ?></li>
<?php else : ?>
<li><?php echo $user_info->display_name; ?></li>
<?php endif; ?>
<?php if( $email = $user_info->user_email ) : ?>
<li><?php echo $email; ?></li>
<?php endif; ?>
<?php if( $aum = get_user_meta( $user->ID, '_aum', true ) ) : ?>
<li><?php printf( __( 'AUM (Millions): %s', 'your-theme-textdomain' ), $aum ); ?></li>
<?php endif; ?>
<?php if( $company = get_user_meta( $user->ID, '_company', true ) ) : ?>
<li><?php echo $company; ?></li>
<?php endif; ?>
<?php if( $strategy = get_user_meta( $user->ID, '_strategy', true ) ) : ?>
<li><?php printf( __( 'Strategy: %s', 'your-theme-textdomain' ), $strategy ); ?></li>
<?php endif; ?>
<?php if( $head_count = get_user_meta( $user->ID, '_head_count', true ) ) : ?>
<li><?php printf( __( 'Head Count: %s', 'your-theme-textdomain' ), $head_count ); ?></li>
<?php endif; ?>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment