author.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Author template
  4. *
  5. * @package vamtam/consulting
  6. */
  7. $author = get_user_by( 'slug', get_query_var( 'author_name' ) );
  8. $description = get_the_author_meta( 'description', $author->ID );
  9. VamtamFramework::set( 'page_title', "<a href='" . get_author_posts_url( $author->ID ) . "' rel='me'>" . ( $author->data->display_name ) . '</a>' );
  10. rewind_posts();
  11. get_header();
  12. ?>
  13. <div class="row page-wrapper">
  14. <?php VamtamTemplates::$in_page_wrapper = true; ?>
  15. <article class="<?php echo esc_attr( VamtamTemplates::get_layout() ) ?>">
  16. <div class="page-content">
  17. <?php if ( ! empty( $description ) ) : ?>
  18. <div class="author-info-box clearfix">
  19. <div class="author-avatar">
  20. <?php echo get_avatar( get_the_author_meta( 'user_email', $author->ID ), 60 ); ?>
  21. </div>
  22. <div class="author-description">
  23. <h4><?php echo sprintf( esc_html__( 'About %s', 'vamtam-consulting' ), wp_kses_post( $author->data->display_name ) ); ?></h4>
  24. <?php echo wp_kses_post( $description ) ?>
  25. </div>
  26. </div>
  27. <?php endif; ?>
  28. <?php rewind_posts() ?>
  29. <?php if ( have_posts() ) : ?>
  30. <?php get_template_part( 'loop', 'archive' ) ?>
  31. <?php else : ?>
  32. <h2 class="no-posts-by-author"><?php sprintf( esc_html__( '%s has not published any posts yet', 'vamtam-consulting' ), $author->data->display_name ) ?></h2>
  33. <?php endif ?>
  34. </div>
  35. </article>
  36. <?php get_template_part( 'sidebar' ) ?>
  37. </div>
  38. <?php get_footer(); ?>