-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-work.php
134 lines (91 loc) · 5.51 KB
/
page-work.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
134
<?php
/*
Template Name: Work Page
*
* This is the base custom page template with the full loop (instead of it split
* out into template parts).
*
* To use for your theme, change the name of your template from
* "Custom Page Example" above. Example:
*
* Template Name: My Custom Page
*
* Then save this template as page-mycustompage.php and it will show up
* as a template in the Page Templates drop-down on page edit screens in the admin.
*
* Important: the "Template Name: " is required by WordPress so that your template
* will show up as a choice in the admin.
*
* Remember to keep the markup and content separate.
*
* For more info: http://codex.wordpress.org/Page_Templates
*
* Visual interactive WordPress template hierarchy: https://wphierarchy.com
*/
?>
<?php get_header(); ?>
<div id="content">
<div id="inner-content" class="wrap">
<main id="main" class="main" role="main" itemscope itemprop="mainContentOfPage" itemtype="https://schema.org/Blog">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> role="article" itemscope itemtype="https://schema.org/BlogPosting">
<header class="article-header">
<h1 class="page-title" itemprop="headline"><?php the_title(); ?></h1>
<!-- <div class="byline-wrap">
10<?php // Get the author name; wrap it in a link.
if ( get_the_author_meta( 'ID' ) ) { $byline = sprintf( __( 'by %s', 'platetheme' ), '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>' );
echo '<span class="posted-on">' . plate_time_link() . '</span><span class="byline"> ' . $byline . '</span>';
} else { echo '<span class="posted-on">Posted on:' . plate_time_link() . '</span>'; }
?>
</div> -->
</header> <?php // end article header ?>
<section class="entry-content" itemprop="articleBody">
<?php the_content(); ?>
</section>
<section class="branding" itemprop="articleBody">
<?php // REPEATER FIELD
$rows = get_field('work');
if( $rows ) {
$image_id = '';
$position = '';
foreach( $rows as $row ) {
if (wp_is_mobile()){ // MOBILE
echo '<image width="330" height="197" src="' . $row['small'] . '"/>';
} else { // DESKTOP
$image_id++;
$position++;
if ( $position == 1 ){ // left image
$transform = 'transform: scale(3.1) translateX(108px);';
} elseif ( $position == 2 ){ // middle image
$transform = 'transform: scale(3.1) translateX(0px);';
} else { // 3 = right image
$transform = 'transform: scale(3.1) translateX(-107px);';
}
?>
<style>#expand-toggle-<?php echo $image_id ?>:checked + label img { <?php echo $transform; ?> }</style>
<input type="checkbox" id="expand-toggle-<? echo $image_id; ?>">
<label for="expand-toggle-<? echo $image_id; ?>">
<image width="330" height="197" srcset="<?php echo $row['small']; ?> 1000w, <?php echo $row['large']; ?> 1001w" />
</label>
<?php
if ($position == 3) {$position = 0;}
}
}
}
?>
<img src="<?php the_field('desktop_1x'); ?>" />
</section> <?php // end article section ?>
<footer class="article-footer">
</footer>
<?php comments_template(); ?>
</article>
<?php endwhile; ?>
<?php plate_page_navi( $wp_query ); ?>
<?php else : ?>
<?php get_template_part( 'templates/404'); ?>
<?php endif; ?>
</main>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>