summaryrefslogtreecommitdiff
path: root/content-movie.php
blob: fe323269c975127625762d972b79738e2f9c8636 (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
<?php
/**
 * @package remulus
 */
?>

<?php
$colors = rwmb_meta('remulus_movie_color');
$background = 'background:' .reset($colors). ';';
if (sizeof($colors) >= 2) {
  $background .= 'background:url(' .get_stylesheet_directory_uri(). '/images/stripes.svg) bottom left no-repeat,linear-gradient(45deg,' .implode(',', $colors). ');';
}
?>

<section id="movie-<?php the_ID(); ?>" class="dark" style="<?php echo $background; ?>">
  <div class="container">

    <div class="description">
    <h3><?php the_title(); ?> (<?php the_time('Y'); ?>)</h3>
      <?php the_content(); ?>
    </div>

    <?php $images = rwmb_meta('remulus_movie_image', 'type=image&size=remulus-movie-small'); ?>
    <?php $single = false; if (sizeof($images) <= 1) $single = true; ?>
    <div class="media<?php if ($single) echo ' media-single'; ?>">
    <?php
    foreach ($images as $image) {
      if ($single) {
        $thumb = wp_get_attachment_image_src($image['ID'], 'remulus-movie');
        echo "<a href='{$image['full_url']}' title='{$image['title']}'><img src='{$thumb[0]}' alt='{$image['alt']}'></a>";
      } else {
        echo "<a href='{$image['full_url']}' title='{$image['title']}'><img src='{$image['url']}' alt='{$image['alt']}'></a>";
      }
    }
    ?>
    </div>

  </div>

</section>