-
Notifications
You must be signed in to change notification settings - Fork 1
/
author.php
92 lines (73 loc) · 2.95 KB
/
author.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/**
* The template for displaying author pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage n00b
* @since 1.0
* @version 1.0
*/
get_header();
$sidebar_pos = n00b_get_option('n00b_options', 'sidebar_position', get_queried_object_id(), array('metabox_prefix' => N00B_META_PREFIX));
$layout_cols = n00b_get_option('n00b_options', 'layout_cols', get_queried_object_id(), array('metabox_prefix' => N00B_META_PREFIX));
$layout_obj = n00b_custom_col_class($layout_cols);
extract($layout_obj); // Returns ($sl_custom_class, $sr_custom_class, $a_custom_class) variables
$sidebar_left_col = n00b_get_col_class($sidebar_pos, 'sidebar_left_col', $sl_custom_class);
$sidebar_right_col = n00b_get_col_class($sidebar_pos, 'sidebar_right_col', $sr_custom_class);
$article_col = n00b_get_col_class($sidebar_pos, 'article_col', $a_custom_class);
?>
<!-- START Title section -->
<section id="title" class="pb-4 mb-5 border-bottom">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<?php global $post; $author_id = $post->post_author; ?>
<h1><?php _e('Posts By:', 'n00b'); ?> <?php the_author_meta('display_name', $author_id); ?></h1>
<?php if (get_the_author_meta('description')) { ?>
<?php echo get_avatar(get_the_author_meta('user_email')); ?>
<h2><?php _e('About ', 'n00b'); the_author_meta('display_name', $author_id); ?></h2>
<?php echo wpautop(get_the_author_meta('description')); ?>
<?php } ?>
</div>
</div>
</div>
</section>
<!-- END Title section -->
<!-- START Breadcrumb section -->
<section id="breadcrumb">
<div class="container-fluid">
<div class="row">
</div>
</div>
</section>
<!-- END Breadcrumb section -->
<!-- START Content section -->
<section id="content">
<div class="container-fluid">
<div class="row">
<?php if ('left' === $sidebar_pos || 'both' === $sidebar_pos || 'both_left' === $sidebar_pos || 'both_right' === $sidebar_pos) { ?>
<aside class="sidebar sidebar-left <?php echo $sidebar_left_col; ?>" role="complementary">
<?php get_sidebar('left'); ?>
</aside>
<?php } ?>
<div class="content <?php echo $article_col; ?>">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part('template-parts/content', 'author'); ?>
<?php endwhile; ?>
<?php get_template_part('template-parts/content', 'pagenav'); ?>
<?php else : ?>
<?php get_template_part('template-parts/content', 'none'); ?>
<?php endif; ?>
</div>
<?php if ('right' === $sidebar_pos || 'both' === $sidebar_pos || 'both_left' === $sidebar_pos || 'both_right' === $sidebar_pos) { ?>
<aside class="sidebar sidebar-right <?php echo $sidebar_right_col; ?>" role="complementary">
<?php get_sidebar('right'); ?>
</aside>
<?php } ?>
</div>
</div>
</section>
<!-- END Content section -->
<?php get_footer(); ?>