-
Notifications
You must be signed in to change notification settings - Fork 1
/
single.php
103 lines (100 loc) · 3.57 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
<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<section id="primary" class="content-area">
<?php
$postObject = get_post_type_object(get_post_type());
$galNum = 0;
if ($postObject) {
$postTypeTitle = esc_html($postObject->name);
$postTypeSingularName = esc_html($postObject->labels->singular_name);
$postTypePluralName = esc_html($postObject->labels->plural_name);
}
$headerimage = get_field($postTypeTitle.'_placeholder_thumb', 'options');
$size = 'full';
echo '<figure class="header-image-box">';
echo wp_get_attachment_image($headerimage['ID'], $size);
echo '<div class="main-title-box '.get_field($postTypeTitle.'_colour', 'options').'-bg">';
echo '<h1>'.$postTypeSingularName.'</h1>';
echo '</div>';
echo '</figure>';
?>
<main id="main" class="single-site-main">
<article>
<?php
if(get_field('header_image')) {
echo '<column>';
$size = 'singleheaderimage';
$headerimage = get_field('header_image');
echo '<figure class="content-box content-box-img content-box-width-6" galnum="'.++$galnum.'" galurl="'.$headerimage['url'].'">';
echo wp_get_attachment_image($headerimage['ID'], $size);
if($headerimage['description'] != '') {
echo '<figcaption>'.$headerimage['caption'].'</figcaption>';
}
echo '</figure>';
echo '</column>';
}
?>
<div class="article-con">
<aside>
<?php echo '<a href="'.get_field('content_roll_page','options').'/?filter='.$postTypeTitle.'">'.get_field('see_more', 'options').' '.$postTypePluralName.'</a>'; ?>
<?php
if(get_field('suggested_time')) {
echo '<h4>'.get_field('suggested_time_string','options').'</h4>';
echo '<p>'.get_field('suggested_time').'</p>';
}
if(get_field('level_of_difficultu')) {
echo '<h4>'.get_field('level_of_difficulty_string','options').'</h4>';
echo '<p>'.get_field('level_of_difficultu').'</p>';
}
if(get_field('materials_needed')) {
echo '<h4>'.get_field('materials_needed_string','options').'</h4>';
echo '<p>'.get_field('materials_needed').'</p>';
}
if(get_field('participants')) {
echo '<h4>'.get_field('participants_string','options').'</h4>';
echo '<p>'.get_field('participants').'</p>';
}
?>
</aside>
<div class="article-content-con">
<?php /*?><?php echo '<h4 class="posttype">'.$postTypeSingularName.'</h4>'; ?><?php */?>
<h1 class="column-title"><?php the_title(); ?></h1>
<?php
echo '<h3 class="byline">';
if(get_field('logged_in_user_as_author') == 1) {
if(get_field('user')) {
$user = get_field('user');
echo $user['display_name'];
} else {
echo get_author_name();
}
} else {
echo get_field('authors');
}
if($postTypeTitle != "workshop") {
echo ' | '.get_the_date('F j, Y').'</h3>';
}
echo '</h3>';
?>
<?php
include('single-content.php');
?>
</div>
</div>
<?php
$rposts = get_field('related_content');
if( $rposts ):
echo '<column><h3 class="column-title blue-text">'.get_field('related_content_title','options').'</h3>';
foreach( $rposts as $item ):
include('infocard.php');
endforeach;
echo '</column>';
endif;
?>
</article>
</main><!-- .site-main -->
</section><!-- .content-area -->
<?php endwhile; endif; ?>
<?php
$GLOBALS['galvar'] = $galnum;
get_footer();