author.php 598 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * The template for displaying Author Archive pages
  4. *
  5. * Methods for TimberHelper can be found in the /lib sub-directory
  6. *
  7. * @package WordPress
  8. * @subpackage Timber
  9. * @since Timber 0.1
  10. */
  11. global $wp_query;
  12. $context = Timber::context();
  13. $context['posts'] = new Timber\PostQuery();
  14. if ( isset( $wp_query->query_vars['author'] ) ) {
  15. $author = new Timber\User( $wp_query->query_vars['author'] );
  16. $context['author'] = $author;
  17. $context['title'] = 'Author Archives: ' . $author->name();
  18. }
  19. Timber::render( array( 'author.twig', 'archive.twig' ), $context );