-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
175 lines (119 loc) · 5.22 KB
/
single.php
File metadata and controls
175 lines (119 loc) · 5.22 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php get_header(); ?>
<div class="row">
<?php if (!has_post_thumbnail()) : ?>
<figure class="featuredImgFront">
<div class="carousel carouselTop slide">
<div class="carousel-inner">
<?php
$gallery_atts = array(
'post_parent' => $post->ID,
'post_mime_type' => 'image'
);
$gallery_images = get_children($gallery_atts);
if (!empty($gallery_images)) {
$gallery_count = count($gallery_images);
for($x=0; $x < $gallery_count; $x++) {
$first_image = array_shift($gallery_images);
$display_first_image = wp_get_attachment_image($first_image->ID);
if ($x==0) {
?>
<div class="item active">
<?php echo $display_first_image; ?>
</div>
<?php } else { ?>
<div class="item">
<?php echo $display_first_image; ?>
</div>
<?php } ?>
<?php } ?>
</div>
<a class="carousel-control left" data-slide="prev">
<span class = "icon-prev"></span>
</a>
<a class="carousel-control right" data-slide="next">
<span class = "icon-next"></span>
</a>
<ol class = "carousel-indicators">
<?php
$x=0;
while ($x < $gallery_count) {
echo '<li></li>';
$x++;
}
?>
</ol>
</div>
<?php
}
?>
</figure>
<?php endif; ?>
<div class="noCarousel">
<!-- MAIN SIDEBAR -->
<div class="mainSidebar col-sm-4">
<?php get_sidebar(); ?>
</div>
<div class="posts col-sm-8">
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php if (has_post_thumbnail() && $x == 0) : ?>
<figure class="featuredImgFront">
<?php the_post_thumbnail(); ?>
</figure>
<?php endif; ?>
<article class="frontPagePosts row-eq-height">
<header>
<h2 class="title"><?php the_title(); ?></h2>
<h4 class="detailsFront">
<?php the_date(get_option('date_format')); ?>
<?php
if (comments_open() && !post_password_required()) {
echo ' | ';
comments_popup_link('0', '1 comment', '% comments', '');
}
?>
</h4>
</header>
<div class="frontContainer">
<div class="frontLeft">
<div class="content">
<?php the_content(); ?>
</div>
</div>
</div>
<?php if (has_tag()) : ?>
<div class="tagContainer">
<div class="tagTitle"><a href="">Tags</a></div>
<?php the_tags( '<ul><li>', '</li><li>', '</li></ul>' ); ?>
</div>
<?php endif; ?>
<?php if (has_category()) : ?>
<div class="categoryContainer">
<div class="categoryTitle"><a href="">Filed in</a></div>
<?php the_category(); ?>
</div>
<?php endif; ?>
</article>
<hr />
<?php endwhile; else : ?>
<article>
<h3>No posts were found</h3>
</article>
<?php endif; ?>
<div class="nav-postsFrontBottom">
<div class="prev">
<h4><?php previous_post_link('← %link', 'PREVIOUS POST', 'false'); ?></h4>
</div>
<div class="next">
<h4><?php next_post_link('%link →', 'NEXT POST', 'false'); ?></h4>
</div>
</div>
<div class="commentContainer" id="comments">
<?php comments_template('', true); ?>
</div>
<a href="#" class="mobile-navigation"></a>
<div class="rwd-sidebar"></div> <!--end rwd-top-nav-->
</div>
</div>
</div>
<hr />
<?php get_footer(); ?>