summaryrefslogtreecommitdiff
path: root/template-movie.php
blob: 0e99d598004a7f7705b53e160a7849e236ad7494 (plain)
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
<?php
/**
 * Template Name: Movie Page (Work)
 *
 * @package remulus
 */

get_header(); ?>

<div class="work">

<?php
$args = array(
  'taxonomy'=> 'movie-type',
  'orderby' => 'id',
);
$categories = get_categories($args);
?>
<?php foreach ($categories as $category): ?>

<h2><?php echo $category->name; ?></h2>
<p><?php echo $category->description; ?></p>

<?php
$args = array(
  'post_type'=> 'movie',
  'movie-type' => $category->slug,
  'posts_per_page' => -1,
);
query_posts($args);
?>
<?php while (have_posts()) : the_post(); ?>

  <?php
    get_template_part('content', 'movie');
  ?>

<?php endwhile; ?>

<?php endforeach; ?>

</div>

<?php get_footer(); ?>