-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharchive.php
85 lines (61 loc) · 2.89 KB
/
archive.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
<?php
/**
* The template for displaying archive pages.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package Envy Blog
*/
get_header();
$blog_layout = get_theme_mod( 'envy-blog_archive_page_layout', 'blog-layout-1' );
?>
<div class="row">
<header class="page-header">
<div class="page-header-content<?php if ( is_author() ) { echo ' is-author-archive'; }?>">
<?php if ( is_author() ) {
$user_id = get_current_user_id();
$author_avatar = get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'envy_blog_author_bio_avatar_size', 75 ) );
if ( $author_avatar ) { ?>
<figure class="author-avatar">
<?php echo wp_kses_post( $author_avatar ); ?>
</figure><!-- .author-avatar -->
<?php } ?>
<div class="author-content">
<?php envy_blog_archive_title( '<h3 class="page-title">', '</h1>' ); ?>
</div><!-- .author-content -->
<?php the_archive_description( '<p>', '</p>' ); ?>
<?php } else {
envy_blog_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description();
} ?>
</div><!-- .page-header-content -->
</header><!-- .page-header -->
</div><!-- .row -->
<div class="row">
<div id="primary" class="content-area">
<?php
if ( have_posts() ) :
// Blog Posts
$blog_classes = array( 'blog-layout' );
$blog_classes[] = $blog_layout;
if ( $blog_layout == 'blog-layout-1' ) {
$columns = get_theme_mod( 'envy-blog_archive_page_layout1_display_columns', 'col-3' );
$blog_classes[] = 'masonry';
$blog_classes[] = 'has-'.$columns;
echo '<div class="'.esc_attr( implode( ' ', $blog_classes ) ).'">';
get_template_part( 'layouts/blog/blog-layout-1', get_post_format() );
echo '</div><!-- .'.esc_attr( $blog_layout ).'-->';
} elseif ( $blog_layout == 'blog-layout-6' ) {
$blog_classes[] = 'has-left-align-image';
echo '<div class="'.esc_attr( implode( ' ', $blog_classes ) ).'">';
get_template_part( 'layouts/blog/blog-layout-6', get_post_format() );
echo '</div><!-- .'.esc_attr( $blog_layout ).'-->';
}
// Pagination
get_template_part( 'layouts/pagination/pagination', get_post_format() );
else :
get_template_part( 'template-parts/content', 'none' );
endif; ?>
</div>
</div><!-- .row -->
<?php get_footer();