Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
author.php template for GP
<?php
/**
* The template for displaying Archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package GeneratePress
*/
get_header(); ?>
<section id="primary" <?php generate_content_class(); ?> itemprop="mainContentOfPage">
<main id="main" <?php generate_main_class(); ?> itemtype="http://schema.org/Blog" itemscope="itemscope" role="main">
<?php do_action('generate_before_main_content'); ?>
<?php if ( have_posts() ) : ?>
<header class="page-header clearfix">
<?php do_action( 'generate_before_archive_title' ); ?>
<h1 class="page-title">
<?php
if ( is_author() ) :
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*/
the_post();
echo get_avatar( get_the_author_meta( 'ID' ), 75 );
printf( __( 'About %s', 'generate' ), '<span class="vcard">' . get_the_author() . '</span>' );
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
endif;
?>
</h1>
<?php do_action( 'generate_after_archive_title' ); ?>
<?php
if ( get_the_author_meta('description') && is_author() ) : // If a user has filled out their decscription show a bio on their entries
echo '<div class="author-info">' . get_the_author_meta('description') . '</div>';
endif;
?>
<?php do_action( 'generate_after_archive_description' ); ?>
</header><!-- .page-header -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php generate_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'archive' ); ?>
<?php endif; ?>
<?php do_action('generate_after_main_content'); ?>
</main><!-- #main -->
</section><!-- #primary -->
<?php
do_action('generate_sidebars');
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment