-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthor.php
66 lines (53 loc) · 1.29 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
<?php
/**
* Author archive template
*
* @package Front_Core
* @subpackage Templates
* @category Archives
* @since 1.0.0
*/
namespace FrontCore;
use function FrontCore\Tags\content_template;
get_header();
?>
<div id="content" class="site-content">
<div id="primary" class="content-area">
<main id="main" class="site-main" itemscope itemprop="mainContentOfPage">
<?php
if ( have_posts() ) :
?>
<header class="page-header">
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$post = get_post_type_object( get_post_type() );
$name = ucwords( $post->labels->menu_name );
if ( is_main_query() && ( is_paged() && 1 == $paged ) || ! is_paged() ) {
get_template_part( FCT_PARTS_DIR . '/content/author-section' );
} else {
printf(
'<h1 class="page-title">%s %s %s</h1>',
$name,
__( 'Authored By', 'frontcore' ),
esc_html( get_the_author() )
);
}
?>
</header>
<?php while ( have_posts() ) : the_post();
content_template();
endwhile;
the_posts_navigation( [
'prev_text' => __( 'Previous', 'frontcore' ),
'next_text' => __( 'Next', 'frontcore' )
] );
else :
content_template();
endif;
?>
</main>
</div>
<?php get_sidebar(); ?>
</div>
<?php
get_footer();