Skip to content

Instantly share code, notes, and snippets.

@danielbachhuber
Created April 26, 2012 00:12
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 danielbachhuber/21788891d530b71ffbc3 to your computer and use it in GitHub Desktop.
Save danielbachhuber/21788891d530b71ffbc3 to your computer and use it in GitHub Desktop.
if ( ! function_exists( 'woo_author_box' ) ) {
function woo_author_box() {
global $post;
$author_id=$post->post_author;
?>
<?php
if ( is_singular() ) {
$i = new CoAuthorsIterator();
while($i->iterate()) {
?>
<div id="post-author">
<div class="profile-image">
<?php echo get_avatar( get_the_author_meta('ID'), '80' ); ?>
</div>
<div class="profile-content">
<h4>
<?php printf( esc_attr__( 'About %s', 'woothemes' ), get_the_author('description', $author_id) ); ?></h4>
<?php echo get_the_author_meta( 'description'); ?>
<?php if (is_singular()) : ?>
<div class="profile-link">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'woothemes' ), get_the_author( 'display_name', $author_id ) ); ?>
</a>
</div><!-- #profile-link -->
<?php endif; ?>
</div>
<div class="fix"></div>
</div>
<?php } ?>
<?php
}
else {
global $post;
if ( is_author() )
$author_id = get_queried_object_id();
else
$author_id=$post->post_author;
?>
<div id="post-author">
<div class="profile-image">
<?php echo get_avatar( $author_id, '80' ); ?>
</div>
<div class="profile-content">
<h4>
<?php printf( esc_attr__( 'About %s', 'woothemes' ), get_the_author_meta( 'display_name', $author_id ) ); ?></h4>
<?php echo get_the_author_meta( 'description', $author_id ); ?>
<?php if (is_singular()) : ?>
<div class="profile-link">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID', $author_id ) ); ?>">
<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'woothemes' ), get_the_author_meta( 'display_name', $author_id ) ); ?>
</a>
</div><!-- #profile-link -->
<?php endif; ?>
</div>
<div class="fix"></div>
</div>
<?php
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment