-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfront-page.php
75 lines (62 loc) · 2.28 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
<?php get_header(); ?>
<section id="blocks">
<div id="vimeo" class="project figure_block project-double">
<iframe src="http://player.vimeo.com/video/49452532?title=0&byline=0&portrait=0&color=00BDF2" width="1024" height="576" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
<a class="project figure_block intro" href="/about/bioticbrands/" title="+ LEARN MORE ABOUT RNO1">
<div>
<p><?php bloginfo('description'); ?></p>
<div class="figcaption">
<p>+ LEARN MORE ABOUT RNO1</p>
</div>
</div>
</a>
<?php get_sidebar('home'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php
$thumb = get_field('thumbnail');
$overlay = get_field('overlay');
$date = get_the_date();
$month = 60 * 60 * 24 * 30;
$new = NULL;
if ( ( strtotime("now") - strtotime( $date ) ) < $month ) {
$new = " new_project";
} else {
$new = false;
}
$terms = get_the_terms( $post->ID, 'type');
$count = count( $terms );
$i = 0;
$types = '';
$klasses = ' ';
$cs = false;
if ( $terms ) :
foreach( $terms as $cat ) {
$i++;
$klasses .= $cat->slug . ' ';
if ( $cat->slug !== 'case-study' ) {
$types .= $cat->name;
if ( $i < $count ) {
$types .= " + ";
}
} else {
$cs = true;
}
}
endif; // if terms
?>
<a class="project figure_block <?php echo $klasses; ?>" href="<?php the_permalink(); ?>">
<figure class="<?php echo ( $cs ) ? 'case_study' : ''; echo $new; ?>">
<img src="<?php echo $overlay['url']; ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" />
<figcaption>
<h2><?php the_title(); ?></h2>
<p><?php echo $types; ?></p>
<img class="overlay" src="<?php echo $thumb['url']; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
</figcaption>
</figure>
</a>
<?php endwhile; ?>
<?php endif; ?>
</section>
<?php //get_template_part( 'inc/nav' ); ?>
<?php get_footer(); ?>