Skip to content

Commit

Permalink
author templates
Browse files Browse the repository at this point in the history
  • Loading branch information
hasinhayder committed Jun 5, 2018
1 parent d7d3c28 commit 8ba3ec0
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
50 changes: 50 additions & 0 deletions author-admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php get_header(); ?>
<body <?php body_class(); ?>>
<?php get_template_part("/template-parts/common/hero"); ?>
<div class="container">
<div class="authorsection authorpage">
<div class="row">
<div class="col-md-2 authorimage">
<?php
echo get_avatar( get_the_author_meta( "ID" ) );
?>
</div>
<div class="col-md-10">
<h4>
<?php echo strtoupper(get_the_author_meta( "display_name" )); ?>
</h4>

<p>
<?php echo get_the_author_meta( "description" ); ?>
</p>

</div>
</div>
</div>
</div>
<div class="posts text-center">
<?php
while ( have_posts() ) {
the_post();
?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></h2></a>
<?php
}
?>

<div class="container post-pagination">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-8">
<?php
the_posts_pagination( array(
"screen_reader_text" => ' ',
"prev_text" => "New Posts",
"next_text" => "Old Posts"
) );
?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
49 changes: 49 additions & 0 deletions author.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php get_header(); ?>
<body <?php body_class(); ?>>
<?php get_template_part("/template-parts/common/hero"); ?>
<div class="container">
<div class="authorsection authorpage">
<div class="row">
<div class="col-md-2 authorimage">
<?php
echo get_avatar( get_the_author_meta( "ID" ) );
?>
</div>
<div class="col-md-10">
<h4>
<?php echo get_the_author_meta( "display_name" ); ?>
</h4>
<p>
<?php echo get_the_author_meta( "description" ); ?>
</p>

</div>
</div>
</div>
</div>
<div class="posts text-center">
<?php
while ( have_posts() ) {
the_post();
?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></h2></a>
<?php
}
?>

<div class="container post-pagination">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-8">
<?php
the_posts_pagination( array(
"screen_reader_text" => ' ',
"prev_text" => "New Posts",
"next_text" => "Old Posts"
) );
?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
2 changes: 1 addition & 1 deletion single.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<?php the_title(); ?>
</h2>
<p class="<?php echo $alpha_text_class; ?>">
<em><?php the_author(); ?></em><br/>
<em><?php the_author_posts_link(); ?></em><br/>
<?php echo get_the_date(); ?>
</p>
</div>
Expand Down
3 changes: 3 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ h2.post-title {
border-radius: 50px;
}

.authorpage{
margin-bottom: 50px;
}



Expand Down

0 comments on commit 8ba3ec0

Please sign in to comment.