-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-template.php
executable file
·133 lines (110 loc) · 5.48 KB
/
front-template.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
<?php
/**
* Template Name: Front
*
* This a custom template for the front page.
* This is the new (late 2012) front page. This front page will display the Villain block,
* a large 1-by-3 row of block images promoting three recent episodes.
* Below that, there is a 3-by-3 grid of episodes in posting order,
* and below that, the fridge or auxillary episodes are listed with the show more link.
*/
get_header(); // Loads the header.php template. ?>
<div id="villain">
<!-- intentionally no wrapping -->
<?php
$v_args = array(
"post_type" => "episode",
"posts_per_page" => 3,
);
$v_args = convergence_exclude_category('tf', $v_args);
$v_args['tax_query'] = array(convergence_exclude_episode_attributes('hidden'));
$v_loop = new WP_Query($v_args);
$villain_episodes = array();
$feature_counter = 1;
while ($v_loop->have_posts()): $v_loop->the_post();
$villain_episodes[] = get_the_ID();
?>
<?php
$f_img = get_the_image(array('size'=>'large', 'link_to_post'=>false, 'format'=>'array' ));
$f_img = convergence_villain_photon_image($f_img['url']);
?>
<div id="<?php echo('villain-feature-' . $feature_counter++); ?>" class="feature" style="background-image: url('<?php echo $f_img; ?>');">
<a class="cover" href="<?php echo get_permalink() ?>">
<div class="mask">
<?php
$show_title = get_the_title();
$show_title_length = strlen($show_title);
$show_title_class = "";
if ($show_title_length > 24) {
$show_title_class = 'long-title ';
} else if ( $show_title_length > 35 ) {
$show_title_class = 'epic-title';
}
?>
<h2 class="show-title <?php echo $show_title_class; ?>"><?php echo $show_title; ?></h2>
<h3 class="show-name">
<span class="name">
<?php $category = get_the_category(); echo($category[0]->name); ?></span>
<span class="sep">#</span><span class="number"><?php echo( get_episode_number( get_permalink() ) ); ?></span>
</h4>
<h4 class="show-date">
<?php echo get_the_date("F j") ?>
<?php
convergence_new_episode(7);
?>
</h5>
</div>
</a>
</div>
<?php endwhile; ?>
<!-- celebrate #villain -->
</div>
<div id="content-container">
<div id="content-wrapper">
<div id="content" class="hfeed content home">
<div id="showboard">
<div id="showboard-wrapper">
<!-- new front page events coming soon! -->
<?php
$showboard_top_arguments = array(
"post_type" => "episode",
"posts_per_page" => 6,
'post__not_in' => $villain_episodes
);
$showboard_top_arguments = convergence_exclude_category('tf', $showboard_top_arguments);
$showboard_top_arguments['tax_query'] = array(convergence_exclude_episode_attributes('hidden'));
$loop_top = new WP_Query($showboard_top_arguments);
?>
<div id="top-shelf">
<?php while ($loop_top->have_posts()): $loop_top->the_post(); ?>
<?php get_template_part('showboard-loop'); ?>
<?php endwhile; ?>
</div>
<?php /* ============================================================= */ ?>
<!-- #top-shelf -->
<?php
$showboard_bottom_arguments = array(
"post_type" => "episode",
"posts_per_page" => 3,
'category_name' => 'tf'
);
$showboard_bottom_arguments['tax_query'] = array(convergence_exclude_episode_attributes('hidden'));
$loop_bottom = new WP_Query($showboard_bottom_arguments);
?>
<div id="bottom-shelf">
<?php while ($loop_bottom->have_posts()): $loop_bottom->the_post(); ?>
<?php get_template_part('showboard-loop'); ?>
<?php endwhile; ?>
<div class="end-cap all-shows">
<h3><a href="<?php echo get_bloginfo('site_url'); ?>/shows">« All Shows</a></h3>
</div>
<div class="end-cap more-episodes">
<h3><a href="<?php echo get_bloginfo('site_url'); ?>/latest">More Episodes »</a></h3>
</div>
</div><!-- #bottom-shelf -->
</div><!-- #showboard-wrapper -->
</div><!-- #showboard -->
</div><!-- .content .hfeed -->
</div><!-- #content-wrapper -->
</div><!-- #content-container -->
<?php get_footer(); // Loads the footer.php template. ?>