-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
230 lines (169 loc) · 10 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?php
/**
* The template for displaying archive pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
get_header(); ?>
<div class="wrap">
<?php if ( have_posts() ) : ?>
<?php
$show_blog_archive_title = (bool)get_theme_mod( 'sed_show_blog_archive_title' , '1' );
$show_blog_archive_description = (bool)get_theme_mod( 'sed_show_blog_archive_description' , '1' );
if( $show_blog_archive_title === true || $show_blog_archive_description === true || site_editor_app_on() ) {
$hide_class = ($show_blog_archive_title === false && $show_blog_archive_description === false) ? "hide" : "";
?>
<header class="page-header <?php echo esc_attr( $hide_class ) ;?>">
<?php
if( $show_blog_archive_title === true || site_editor_app_on() ) {
$hide_class = ($show_blog_archive_title === false) ? "hide" : "";
the_archive_title('<h1 class="page-title '. esc_attr( $hide_class ) .'">', '</h1>');
}
if( $show_blog_archive_description === true || site_editor_app_on() ) {
$hide_class = ($show_blog_archive_description === false) ? "hide" : "";
the_archive_description( '<div class="taxonomy-description '. esc_attr( $hide_class ) .'">', '</div>' );
}
?>
</header><!-- .page-header -->
<?php } ?>
<?php endif; ?>
<div id="primary" class="content-area sed-blog-content blog-content-area">
<main id="main" class="site-main" role="main">
<section class="content">
<?php $i = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post row'); ?>>
<?php
ob_start();
the_excerpt();
$excerpt = ob_get_clean();
if( strlen($excerpt) > 250 ){
$excerpt = mb_substr( $excerpt , 0, 250 )."...";
}
?>
<?php if (($i % 2) == 0) { ?>
<?php if (iott_get_field('show_thumbnail')) { ?>
<div class="col-lg-12">
<header class="entry-header">
<div class="category">
<?php the_category(); ?>
</div>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<hr class="little-separator" />
</header>
<section class="entry-content">
<p class="excerpt"><?php echo $excerpt ?></p>
<?php if ( !empty( iott_get_field('advertise_image') ) ) { ?>
<div class="sponsor">
<h6>Sponsored By:</h6>
<a href="<?php iott_the_field('advertise_link'); ?>" target="_blank"><?php the_sponsored_image( iott_get_field('advertise_image') ); ?></a>
</div>
<?php } ?>
<div class="more-info">
<a href="<?php the_permalink(); ?>" title="اطلاعات بیشتر در رابطه با <?php the_title(); ?>">اطلاعات بیشتر</a>
</div>
</section>
</div>
<?php } else { ?>
<div class="col-lg-6">
<?php if ('' !== get_the_post_thumbnail() && ! is_single()) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('home'); ?>
</a>
</div>
<?php endif; ?>
</div>
<div class="col-lg-6">
<header class="entry-header">
<div class="category">
<?php the_category(); ?>
</div>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<hr class="little-separator" />
</header>
<section class="entry-content">
<div class="excerpt"><?php echo $excerpt ?></div>
<?php if ( !empty( iott_get_field('advertise_image') ) ) { ?>
<div class="sponsor">
<h6>Sponsored By:</h6>
<a href="<?php iott_the_field('advertise_link'); ?>" target="_blank"><?php the_sponsored_image( iott_get_field('advertise_image') ); ?></a>
</div>
<?php } ?>
<div class="more-info">
<a href="<?php the_permalink(); ?>" title="اطلاعات بیشتر در رابطه با <?php the_title(); ?>">اطلاعات بیشتر</a>
</div>
</section>
</div>
<?php } ?>
<?php } else { ?>
<?php if (iott_get_field('show_thumbnail')) { ?>
<div class="col-lg-12">
<header class="entry-header">
<div class="category">
<?php the_category(); ?>
</div>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<hr class="little-separator" />
</header>
<section class="entry-content">
<p class="excerpt"><?php echo $excerpt ?></p>
<?php if ( !empty( iott_get_field('advertise_image') ) ) { ?>
<div class="sponsor">
<h6>Sponsored By:</h6>
<a href="<?php iott_the_field('advertise_link'); ?>" target="_blank"><?php the_sponsored_image( iott_get_field('advertise_image') ); ?></a>
</div>
<?php } ?>
<div class="more-info">
<a href="<?php the_permalink(); ?>" title="اطلاعات بیشتر در رابطه با <?php the_title(); ?>">اطلاعات بیشتر</a>
</div>
</section>
</div>
<?php } else { ?>
<div class="col-lg-6">
<header class="entry-header">
<div class="category">
<?php the_category(); ?>
</div>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<hr class="little-separator" />
</header>
<section class="entry-content">
<div class="excerpt"><?php echo $excerpt ?></div>
<?php if ( !empty( iott_get_field('advertise_image') ) ) { ?>
<div class="sponsor">
<h6>Sponsored By:</h6>
<a href="<?php iott_the_field('advertise_link'); ?>" target="_blank"><?php the_sponsored_image( iott_get_field('advertise_image') ); ?></a>
</div>
<?php } ?>
<div class="more-info">
<a href="<?php the_permalink(); ?>" title="اطلاعات بیشتر در رابطه با <?php the_title(); ?>">اطلاعات بیشتر</a>
</div>
</section>
</div>
<div class="col-lg-6 visible-lg">
<?php if ('' !== get_the_post_thumbnail() && !is_single()) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('home'); ?>
</a>
</div>
<?php endif; ?>
</div>
<?php } ?>
<?php } ?>
</article>
<?php $i++; endwhile;
wp_pagenavi();
else :
endif; ?>
</section>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .wrap -->
<?php get_footer();