This repository has been archived by the owner on Jan 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
187 lines (172 loc) · 11.6 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
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
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
*/
get_header();
?>
<!-- HEADER TITLE BREADCRUBS SECTION -->
<?php
$first_post_slide = get_theme_mod( 'first_post_slide' );
$second_post_slide = get_theme_mod( 'second_post_slide' );
$third_post_slide = get_theme_mod( 'third_post_slide' );
$first_post = get_page_by_title($first_post_slide, OBJECT, 'post');
$second_post = get_page_by_title($second_post_slide, OBJECT, 'post');
$third_post = get_page_by_title($third_post_slide, OBJECT, 'post');
$themecheck_checkbox_setting_id = get_theme_mod( 'themecheck_checkbox_setting_id' );
if($themecheck_checkbox_setting_id != 0) {
if(!empty($first_post) && !empty($second_post) && !empty($third_post)) {
$thumbnail_src_first_post = wp_get_attachment_image_src( get_post_thumbnail_id( $first_post->ID ),'political_blog_1400x350' );
$thumbnail_src_second_post = wp_get_attachment_image_src( get_post_thumbnail_id( $second_post->ID ),'political_blog_1400x350' );
$thumbnail_src_third_post = wp_get_attachment_image_src( get_post_thumbnail_id( $third_post->ID ),'political_blog_1400x350' );
?>
<div class="political-homepage-slider">
<div id="political-homepage-slider-owl-top" class="owl-carousel owl-theme">
<div class="item">
<div class="posts_carousel_single__body">
<div class="posts_carousel_single__body__div">
<span class="post-date-author">
<span class="date"><i class="icon-calendar"></i> <?php echo esc_html(get_the_date(get_option('date_format'),$first_post->ID)); ?></span>
<?php $author_id_1 = $first_post->post_author; ?>
<?php esc_html_e('| ','political') ?> <span class="author"> <?php the_author_meta( 'display_name' , $author_id_1 ); ?></span>
</span>
<a href="<?php esc_url(the_permalink($first_post->ID)); ?>" class="relative">
<h5><?php echo esc_html(get_the_title($first_post->ID)); ?></h5>
</a>
<span class="post-tags">
<?php echo get_the_term_list( $first_post->ID, 'category', '', ', ' ); ?>
</span>
</div>
</div>
<?php if($thumbnail_src_first_post) { ?>
<div class="item-image"><img class="blog_post_image" src="<?php echo esc_url($thumbnail_src_first_post[0]); ?>" alt="<?php echo esc_attr(get_the_title($first_post->ID)); ?>" /></div>
<?php } ?>
</div>
<div class="item">
<div class="posts_carousel_single__body">
<div class="posts_carousel_single__body__div">
<span class="post-date-author">
<span class="date"><i class="icon-calendar"></i> <?php echo esc_html(get_the_date(get_option('date_format'),$second_post->ID)); ?></span>
<?php $author_id_2 = $second_post->post_author; ?>
<?php esc_html_e('| ','political') ?> <span class="author"> <?php the_author_meta( 'display_name' , $author_id_2 ); ?></span>
</span>
<a href="<?php esc_url(the_permalink($second_post->ID)); ?>" class="relative">
<h5><?php echo esc_html(get_the_title($second_post->ID)); ?></h5>
</a>
<span class="post-tags">
<?php echo get_the_term_list( $second_post->ID, 'category', '', ', ' ); ?>
</span>
</div>
</div>
<?php if($thumbnail_src_second_post) { ?>
<div class="item-image"><img class="blog_post_image" src="<?php echo esc_url($thumbnail_src_second_post[0]); ?>" alt="<?php echo esc_attr(get_the_title($second_post->ID)); ?>" /></div>
<?php } ?>
</div>
<div class="item">
<div class="posts_carousel_single__body">
<div class="posts_carousel_single__body__div">
<span class="post-date-author">
<span class="date"><i class="icon-calendar"></i> <?php echo esc_html(get_the_date(get_option('date_format'),$third_post->ID)); ?></span>
<?php $author_id_3 = $third_post->post_author; ?>
<?php esc_html_e('| ','political') ?> <span class="author"> <?php the_author_meta( 'display_name' , $author_id_3 ); ?></span>
</span>
<a href="<?php esc_url(the_permalink($third_post->ID)); ?>" class="relative">
<h5><?php echo esc_html(get_the_title($third_post->ID)); ?></h5>
</a>
<span class="post-tags">
<?php echo get_the_term_list( $third_post->ID, 'category', '', ', ' ); ?>
</span>
</div>
</div>
<?php if($thumbnail_src_third_post) { ?>
<div class="item-image"><img class="blog_post_image" src="<?php echo esc_url($thumbnail_src_third_post[0]); ?>" alt="<?php echo esc_attr(get_the_title($third_post->ID)); ?>" /></div>
<?php } ?>
</div>
</div>
<div id="political-homepage-slider-owl-bottom" class="owl-carousel owl-theme">
<div class="item">
<div class="posts_carousel_single__body_recent">
<span class="post-date-author">
<span class="date"><i class="icon-calendar"></i> <?php echo esc_html(get_the_date(get_option('date_format'),$first_post->ID)); ?></span>
<?php $author_id_1 = $first_post->post_author; ?>
<?php esc_html_e('| ','political') ?> <span class="author"> <?php the_author_meta( 'display_name' , $author_id_1 ); ?></span>
</span>
<a href="<?php esc_url(the_permalink($first_post->ID)); ?>" class="relative">
<h5><?php echo esc_html(get_the_title($first_post->ID)); ?></h5>
</a>
<span class="post-tags">
<?php echo get_the_term_list( $first_post->ID, 'category', '', ', ' ); ?>
</span>
</div>
</div>
<div class="item">
<div class="posts_carousel_single__body_recent">
<span class="post-date-author">
<span class="date"><i class="icon-calendar"></i> <?php echo esc_html(get_the_date(get_option('date_format'),$second_post->ID)); ?></span>
<?php $author_id_2 = $second_post->post_author; ?>
<?php esc_html_e('| ','political') ?> <span class="author"> <?php the_author_meta( 'display_name' , $author_id_2 ); ?></span>
</span>
<a href="<?php esc_url(the_permalink($second_post->ID)); ?>" class="relative">
<h5><?php echo esc_html(get_the_title($second_post->ID)); ?></h5>
</a>
<span class="post-tags">
<?php echo get_the_term_list( $second_post->ID, 'category', '', ', ' ); ?>
</span>
</div>
</div>
<div class="item">
<div class="posts_carousel_single__body_recent">
<span class="post-date-author">
<span class="date"><i class="icon-calendar"></i> <?php echo esc_html(get_the_date(get_option('date_format'),$third_post->ID)); ?></span>
<?php $author_id_3 = $third_post->post_author; ?>
<?php esc_html_e('| ','political') ?> <span class="author"> <?php the_author_meta( 'display_name' , $author_id_3 ); ?></span>
</span>
<a href="<?php esc_url(the_permalink($third_post->ID)); ?>" class="relative">
<h5><?php echo esc_html(get_the_title($third_post->ID)); ?></h5>
</a>
<span class="post-tags">
<?php echo get_the_term_list( $third_post->ID, 'category', '', ', ' ); ?>
</span>
</div>
</div>
</div>
</div>
<?php
}
}
?>
<!-- Page content -->
<div class="high-padding" id="main-content">
<!-- Blog content -->
<div class="container blog-posts">
<div class="row">
<div class="col-md-9 main-content">
<?php if ( have_posts() ) : ?>
<div class="row">
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php /* Loop - Variant 1 */ ?>
<?php get_template_part( 'content', 'blogloop-v3' ); ?>
<?php endwhile; ?>
<div class="political-pagination-holder col-md-12">
<div class="political-pagination pagination">
<?php the_posts_pagination(); ?>
</div>
</div>
</div>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</div>
<div class="col-md-3 sidebar-content">
<?php get_sidebar(); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>