-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage-channels.php
67 lines (59 loc) · 2.01 KB
/
page-channels.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
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package CreativeDisturbance
*/
get_header();
$channels = get_terms(array(
'taxonomy' => 'series',
'hide_empty' => false,
'meta_key' => 'archived',
'meta_value' => '0'
));
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
set_query_var('display_title', the_title('', '', false));
get_template_part('template-parts/title'); ?>
<div class="container">
<div class="row all-channels-row">
<?php
$i = 1;
foreach ($channels as $channel):
$media_id = get_term_meta( $channel->term_id, 'podcast_series_image_settings', true );
$image_attributes = wp_get_attachment_image_src( $media_id, 'large' );
$language = get_term_meta( $channel->term_id, 'language', true );
$src = $image_attributes[0];
$name = $channel->name;
$slug = $channel->slug;
$description = $channel->description; ?>
<div class="col-sm-3">
<a class="link-block link-channel" href="<?php echo get_term_link($channel->term_id) ?>">
<img src="<?php echo $src ?>" alt="<?php echo $name ?>" class="img-responsive">
<h3><?php echo $name ?></h3>
<p class="text-muted"><?php echo $language['post_title']; ?></p>
<p><?php echo wp_trim_words($description, 15) ?></p>
</a>
</div>
<?php
if ($i%4 == 0) echo '</div><div class="row">';
$i++;
endforeach;
if ($i%4 != 0) echo '</div>'; ?>
</div>
<div class='container'>
<div class='row'>
<div class='col'>
<h2>Archived Channels</h2>
<p>Check out all the <a href="<?php echo site_url( '/archived-channels/');?>">Archived Channels</a></p>
</div>
</div>
</div>
</main>
</div>
<?php
get_footer();