PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/catch-box/author.php

https://github.com/ActivateNY/activateny.org
PHP | 84 lines | 46 code | 16 blank | 22 comment | 4 complexity | 5bd79d7b346130705f33e09c4d78f426 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * The template for displaying Author Archive pages.
  4. *
  5. * @package Catch Themes
  6. * @subpackage Catch_Box
  7. * @since Catch Box 1.0
  8. */
  9. get_header(); ?>
  10. <?php if ( have_posts() ) : ?>
  11. <?php
  12. /* Queue the first post, that way we know
  13. * what author we're dealing with (if that is the case).
  14. *
  15. * We reset this later so we can run the loop
  16. * properly with a call to rewind_posts().
  17. */
  18. the_post();
  19. ?>
  20. <header class="page-header">
  21. <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'catchbox' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
  22. </header>
  23. <?php
  24. /* Since we called the_post() above, we need to
  25. * rewind the loop back to the beginning that way
  26. * we can run the loop properly, in full.
  27. */
  28. rewind_posts();
  29. ?>
  30. <?php
  31. // If a user has filled out their description, show a bio on their entries.
  32. if ( get_the_author_meta( 'description' ) ) : ?>
  33. <div id="author-info">
  34. <div id="author-avatar">
  35. <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'catchbox_author_bio_avatar_size', 60 ) ); ?>
  36. </div><!-- #author-avatar -->
  37. <div id="author-description">
  38. <h2><?php printf( __( 'About %s', 'catchbox' ), get_the_author() ); ?></h2>
  39. <?php the_author_meta( 'description' ); ?>
  40. </div><!-- #author-description -->
  41. </div><!-- #entry-author-info -->
  42. <?php endif; ?>
  43. <?php /* Start the Loop */ ?>
  44. <?php while ( have_posts() ) : the_post(); ?>
  45. <?php
  46. /* Include the Post-Format-specific template for the content.
  47. * If you want to overload this in a child theme then include a file
  48. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  49. */
  50. get_template_part( 'content', get_post_format() );
  51. ?>
  52. <?php endwhile; ?>
  53. <?php catchbox_content_nav( 'nav-below' ); ?>
  54. <?php else : ?>
  55. <article id="post-0" class="post no-results not-found">
  56. <header class="entry-header">
  57. <h1 class="entry-title"><?php _e( 'Nothing Found', 'catchbox' ); ?></h1>
  58. </header><!-- .entry-header -->
  59. <div class="entry-content">
  60. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'catchbox' ); ?></p>
  61. <?php get_search_form(); ?>
  62. </div><!-- .entry-content -->
  63. </article><!-- #post-0 -->
  64. <?php endif; ?>
  65. </div><!-- #content -->
  66. </div><!-- #primary -->
  67. <?php get_sidebar(); ?>
  68. <?php get_footer(); ?>