-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
140 lines (110 loc) · 4.95 KB
/
single.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
135
136
137
138
139
140
<?php get_header(); ?>
<table cellpadding="0" cellspacing="0" border="0" id="backgroundTable">
<tr>
<td>
<!-- HEADER -->
<table cellpadding="0" cellspacing="0" border="0" align="center" class="head-wrap">
<!-- row -->
<tr>
<td>
</td>
<td class="header container">
<div class="header-logo content">
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td>
<a href="http://arts.vcu.edu/" target="_blank">
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/library/images/vcuarts.png" width="140" height="30" />
</a>
</td>
</tr>
</table>
</div>
</td>
<td>
</td>
</tr>
<!-- end of row -->
</table>
<!-- /HEADER -->
<!-- BODY -->
<table cellpadding="0" cellspacing="0" border="0" align="center" class="body-wrap">
<tr>
<td></td>
<td class="container" bgcolor="#FFFFFF">
<div class="content">
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td>
<?php
$email_title = get_field( 'email_title' );
if ( $email_title ) : ?>
<center><h1 class="email-title"><?php echo esc_html( $email_title ); ?></h1></center>
<?php endif; ?>
</td>
</tr>
</table>
</div> <!-- closing content before hero -->
<?php
// check if the flexible content field has rows of data
if ( have_rows( 'email_content' ) ) :
// loop through the rows of data
while ( have_rows( 'email_content' ) ) : the_row();
// check current row layout
if ( get_row_layout() == 'hero_image_module' ) :
get_template_part( 'library/flexible-content/hero', 'module' );
elseif ( get_row_layout() == 'wsiwyg_module' ) :
get_template_part( 'library/flexible-content/wsiwyg', 'module' );
elseif ( get_row_layout() == 'gallery' ) :
get_template_part( 'library/flexible-content/gallery', 'module' );
endif;
endwhile;
endif;
$chunks = get_field( 'chunks' );
$chunk_count = 0;
if ( $chunks ) : ?>
<div class="content">
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td>
<div class="chunks">
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<?php foreach ( $chunks as $post ) : // variable must be called $post (IMPORTANT)
setup_postdata( $post );
$image = get_field( 'chunk_image' );
$image_url = false;
if ( $image ) {
$image_url = isset( $image['sizes']['chunks-thumb'] ) ? $image['sizes']['chunks-thumb'] : $image['url'];
}
$chunk_title = get_field( 'chunk_headline' );
$chunk_content = get_field( 'chunk_content' );
$chunk_link = get_field( 'more_link' ); ?>
<?php if ( 1 == $chunk_count++ % 2 ) : ?>
<td class="column column-two" width="230" align="right" valign="top">
<?php else : ?>
<td class="column column-one" width="230" align="left" valign="top">
<?php endif; ?>
<?php if ( $image_url ) : ?><img class="chunk-img" src="<?php echo esc_url( $image_url ); ?>"><?php endif; ?>
<?php if ( $chunk_title ) :?>
<h5 class="chunk-title"><?php echo esc_html( $chunk_title ); ?></h5>
<?php endif; ?>
<?php if ( $chunk_content ) :
the_field( 'chunk_content' );
endif; ?>
<?php if ( $chunk_link ) : ?><a href="<?php echo esc_url( $chunk_link ); ?>" target="_blank"><img class="more-btn" src="<?php echo esc_url( get_template_directory_uri() ); ?>/library/images/more-btn.png" /></a> <?php endif; ?>
</td>
<?php endforeach; ?>
<?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<?php endif; ?>
</td>
</tr>
</table><!-- /BODY -->
<?php get_footer();