-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-sed_events.php
165 lines (99 loc) · 5.22 KB
/
archive-sed_events.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
<?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 blog-content-area">
<main id="main" class="site-main" role="main">
<section class="content">
<?php
$i = 0;
$current_day = '';
$current_month = '';
if ( have_posts() ) :
while ( have_posts() ) : the_post();
?>
<div class="timeline-content-area <?php iott_the_field('event_color'); ?>">
<?php
$event_logo_id = iott_get_field('event_image');
$img = get_sed_attachment_image_html( $event_logo_id , "medium" );
if ( ! $img ) {
$img = array();
$img['thumbnail'] = '<img class="sed-image-placeholder sed-image" src="' . sed_placeholder_img_src() . '" />';
}
$new_day = iott_get_field('event_day');
$new_month = iott_get_field('event_month');
$year = iott_get_field('event_year');
$year = !$year ? '' : $year;
if( $new_day && ( $new_day != $current_day || ( $new_month && $new_month != $current_month ) ) ){
$current_day = $new_day;
$current_month = $new_month;
?>
<div class="date-wrap clearfix">
<div class="date"><span><?php echo $new_day;?></span></div>
<span class="line"></span>
<div class="full-date-wrap">
<span class="day-num"><?php echo $new_day;?></span>
<span class="full-date"><?php echo $new_month . " " . $year;?></span>
</div>
</div>
<?php } ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('item-content'); ?>>
<div class="content-desc">
<div class="title">
<a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a>
</div>
<div class="image">
<?php echo $img['thumbnail'] ; ?>
</div>
<hr class="little-separator">
<div class="text">
<div><?php the_excerpt(); ?></div>
</div>
<div class="more-info">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" > اطلاعات بیشتر </a>
</div>
</div>
</div>
</div>
<?php
$i++;
endwhile;
wp_pagenavi();
endif;
?>
</section>
</main>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer();