author.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * The template for displaying Author archive pages
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package WordPress
  8. * @subpackage Twenty_Fourteen
  9. * @since Twenty Fourteen 1.0
  10. */
  11. get_header(); ?>
  12. <section id="primary" class="content-area">
  13. <div id="content" class="site-content" role="main">
  14. <?php if ( have_posts() ) : ?>
  15. <header class="archive-header">
  16. <h1 class="archive-title">
  17. <?php
  18. /*
  19. * Queue the first post, that way we know what author
  20. * we're dealing with (if that is the case).
  21. *
  22. * We reset this later so we can run the loop properly
  23. * with a call to rewind_posts().
  24. */
  25. the_post();
  26. printf( __( 'All posts by %s', 'twentyfourteen' ), get_the_author() );
  27. ?>
  28. </h1>
  29. <?php if ( get_the_author_meta( 'description' ) ) : ?>
  30. <div class="author-description"><?php the_author_meta( 'description' ); ?></div>
  31. <?php endif; ?>
  32. </header><!-- .archive-header -->
  33. <?php
  34. /*
  35. * Since we called the_post() above, we need to rewind
  36. * the loop back to the beginning that way we can run
  37. * the loop properly, in full.
  38. */
  39. rewind_posts();
  40. // Start the Loop.
  41. while ( have_posts() ) : the_post();
  42. /*
  43. * Include the post format-specific template for the content. If you want to
  44. * use this in a child theme, then include a file called called content-___.php
  45. * (where ___ is the post format) and that will be used instead.
  46. */
  47. get_template_part( 'content', get_post_format() );
  48. endwhile;
  49. // Previous/next page navigation.
  50. twentyfourteen_paging_nav();
  51. else :
  52. // If no content, include the "No posts found" template.
  53. get_template_part( 'content', 'none' );
  54. endif;
  55. ?>
  56. </div><!-- #content -->
  57. </section><!-- #primary -->
  58. <?php
  59. get_sidebar( 'content' );
  60. get_sidebar();
  61. get_footer();