-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
executable file
·210 lines (147 loc) · 6.07 KB
/
front-page.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
<?php
/**
* *PHP version 8.0
*
* Front page | core/front-page.php.
*
* @category Front_Page
* @package Clashvibes
* @subpackage Front_Page
* @author Raymond Thompson <ray_thomp@hushmail.com>
* @copyright 2017 Raymond Thompson
* @license http://www.gnu.org/licenses/gpl-3.0.en.html GPLv3
* @version GIT: https://github.com/raythompsonwebdev/clashvibes .git
* @link http:www.raythompsonwebdev.co.uk custom template.
*/
get_header(); ?>
<section id="clashvibes-banner">
<img src="<?php echo esc_url(home_url('/')); ?>/wp-content/uploads/2023/06/sliderimage.webp" alt="<?php esc_attr_e('sliderimage', 'clashvibes'); ?>">
</section>
<h2><?php esc_html_e('Latest Sound Clashes ', 'clashvibes'); ?></h2>
<section id="new-releases-section">
<?php
$new_releases_args = array(
'post_type' => 'post',
'category_name' => 'new releases',
'post_count' => '5',
'post_status' => 'publish',
'posts_per_page' => -1,
);
$new_clashes_query = new WP_Query($new_releases_args);
?>
<?php
if ($new_clashes_query->have_posts() ) :
while ( $new_clashes_query->have_posts() ) :
$new_clashes_query->the_post();
?>
<figure class="new-releases-item">
<?php
the_post_thumbnail('thumbnail', array( 'class' => 'new-release-thumb' ));
?>
<figcaption class="new-releases-caption">
<h3 class="new-releases-header">
<?php echo esc_html(the_title()); ?>
</h3>
<?php if (is_category('audio-clashes') ) : ?>
<a class="new-release-btn" href=" <?php echo esc_url(get_permalink(), 'clashvibes'); ?> " title="Listen to <?php the_title_attribute(); ?>">
<?php esc_html_e('Listen', 'clashvibes'); ?></a>
<?php else : ?>
<a class="new-release-btn" href=" <?php echo esc_url(get_permalink(), 'clashvibes'); ?> " title="View <?php the_title_attribute(); ?> Video">
<?php esc_html_e('View', 'clashvibes'); ?></a>
<?php endif; ?>
</figcaption>
</figure>
<?php
wp_reset_postdata();
?>
<?php endwhile; ?>
<?php else : ?>
<article class="new-releases-item">
<figure class="new-release-thumb">
<figcaption class="new-releases-caption">
<h3 class="new-releases-header"><?php esc_html_e('Sorry! No clashes to display.', 'clashvibes'); ?></h3>
</figcaption>
</figure>
</article>
<?php endif; ?>
</section>
<div id="top-clashes-section">
<section id="top-audio-clashes">
<h4 class="top-clashes-title"><?php esc_html_e('Top Audio Clashes ', 'clashvibes'); ?></h5>
<?php
$top_audio_args = array(
'post_type' => 'post',
'category_name' => 'top-audio',
'post_count' => '5',
'post_status' => 'publish',
'posts_per_page' => -1,
);
$top_audio_query = new WP_Query($top_audio_args);
?>
<?php
if ($top_audio_query->have_posts() ) :
while ( $top_audio_query->have_posts() ) :
$top_audio_query->the_post();
?>
<span class="top-clash-item">
<span class="top-clash-img">
<a href="<?php echo esc_url(get_permalink()); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail('popular-image'); ?>
</a>
</span>
<span class="top-clash-name">
<?php echo esc_html(the_title()); ?>
</span>
<a class="top-clash-link" href="<?php echo esc_url(get_permalink(), 'clashvibes'); ?>" title="Listen to <?php the_title_attribute(); ?>">
<?php esc_html_e('Listen', 'clashvibes'); ?>
</a>
</span>
<?php
wp_reset_postdata();
?>
<?php endwhile; ?>
<?php else : ?>
<p><?php esc_html_e('Oops! There are no posts to display.', 'clashvibes'); ?></p>
<?php endif; ?>
</section>
<section id="top-video-clashes">
<h4 class="top-clashes-title"><?php esc_html_e('Top Video Clashes', 'clashvibes'); ?></h4>
<?php
$top_video_args = null;
$top_video_args = array(
'post_type' => 'post',
'category_name' => 'top-video',
'post_count' => '5',
'post_status' => 'publish',
'posts_per_page' => -1,
);
$top_video_query = new WP_Query($top_video_args);
?>
<?php
if ($top_video_query->have_posts() ) :
while ( $top_video_query->have_posts() ) :
$top_video_query->the_post();
?>
<span class="top-clash-item">
<span class="top-clash-img">
<a href="<?php echo esc_url(get_permalink()); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail('popular-image'); ?>
</a>
</span>
<span class="top-clash-name">
<?php echo esc_html(the_title()); ?>
</span>
<a class="top-clash-link" href="<?php echo esc_url(get_permalink()); ?>" title="View <?php the_title_attribute(); ?> Video">
<?php esc_html_e('View', 'clashvibes'); ?>
</a>
</span>
<?php endwhile; ?>
<?php else : ?>
<p><?php esc_html_e('Oops! There are no posts to display.', 'clashvibes'); ?></p>
<?php
endif;
wp_reset_postdata();
?>
</section>
</div>
<?php get_footer(); ?>