/
index.php
160 lines (102 loc) · 3.83 KB
/
index.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php get_header(); ?>
<main id="site-content" role="main">
<div class="site-content-inner">
<?php
$archive_prefix = eksell_get_the_archive_title_prefix();
$archive_title = get_the_archive_title();
$archive_description = get_the_archive_description( '<div>', '</div>' );
do_action( 'eksell_before_archive_header' );
if ( $archive_title || $archive_description || ( eksell_show_home_filter() ) ) :
// By default, only use the grid structure in the archive header if we have both a title and a description.
$use_header_grid = apply_filters( 'eksell_archive_header_use_grid', $archive_title && $archive_description );
?>
<header class="archive-header section-inner">
<?php if ( $use_header_grid ) : ?>
<div class="archive-header-grid grid cols-tl-6 no-v-gutter">
<div class="col">
<?php
endif;
do_action( 'eksell_archive_header_start' );
if ( $archive_prefix ) :
?>
<p class="archive-prefix color-accent i-a a-fade-up"><?php echo $archive_prefix; ?></p>
<?php
endif;
if ( $archive_title ) :
// If we're outputting the home text or the Jetpack Portfolio archive text (in the latter case, only when a text is set), output the title in a div to enable multiple paragraphs.
if ( ( is_home() && ! is_paged() ) || ( is_post_type_archive( 'jetpack-portfolio' ) && ! is_paged() && get_theme_mod( 'eksell_jetpack_portfolio_archive_text', '' ) ) ) :
?>
<div class="archive-title has-paragraphs contain-margins i-a a-fade-up"><?php echo wpautop( $archive_title ); ?></div>
<?php
else :
?>
<h1 class="archive-title i-a a-fade-up"><?php echo $archive_title; ?></h1>
<?php
endif;
endif;
if ( $use_header_grid ) : ?>
</div><!-- .col -->
<div class="col">
<?php
endif;
if ( $archive_description ) :
?>
<div class="archive-description mw-small contain-margins i-a a-fade-up a-del-100"><?php echo wpautop( $archive_description ); ?></div>
<?php
endif;
/*
* @hooked eksell_the_archive_filter - 10
*/
do_action( 'eksell_archive_header_end' );
if ( $use_header_grid ) :
?>
</div><!-- .col -->
</div><!-- .archive-header-grid -->
<?php
endif;
?>
</header><!-- .archive-header -->
<?php
endif;
do_action( 'eksell_after_archive_header' );
if ( have_posts() ) :
?>
<div class="posts">
<div class="section-inner">
<?php
do_action( 'eksell_posts_start' );
// Get the column classes, based on the settings in the Customizer.
$archive_columns_classes_array = eksell_get_archive_columns_classes();
$archive_columns_classes = $archive_columns_classes_array ? ' ' . implode( ' ', $archive_columns_classes_array ) : '';
?>
<div class="posts-grid grid load-more-target<?php echo esc_attr( $archive_columns_classes ); ?>">
<div class="col grid-sizer"></div>
<?php
while ( have_posts() ) :
the_post();
?>
<div class="article-wrapper col">
<?php get_template_part( 'inc/parts/preview', get_post_type() ); ?>
</div>
<?php
endwhile;
?>
</div><!-- .posts-grid -->
<?php
do_action( 'eksell_posts_end' );
?>
</div><!-- .section-inner -->
</div><!-- .posts -->
<?php
get_template_part( 'pagination' );
elseif ( is_search() ) :
?>
<div class="no-search-results-form section-inner contain-margins">
<?php get_search_form(); ?>
</div><!-- .no-search-results -->
<?php
endif;
?>
</div><!-- .site-content-inner -->
</main><!-- #site-content -->
<?php get_footer(); ?>