This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
177 lines (134 loc) · 6.83 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
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
176
177
<?php
/**
*
* The template for displaying all single posts and attachments
*
* @package WordPress
* @subpackage Materialize
* @since Materialize 1.0
*/
get_header(); ?>
<?php
if( (bool)get_theme_mod( 'mythemes-show-breadcrumbs', true ) ){
?>
<!-- the breadcrumbs content -->
<div class="mythemes-page-header">
<!-- the breadcrumbs container ( align to center ) -->
<div class="container">
<div class="row">
<div class="col s12">
<!-- the breadcrumbs navigation path -->
<nav class="mythemes-navigation">
<ul>
<!-- the home link -->
<?php echo mythemes_breadcrumbs::home(); ?>
<!-- the post categories ( hierarchical path ) -->
<?php
global $post;
$categories = array_reverse( get_the_category( $post -> ID ) );
if( !empty( $categories ) ){
foreach( $categories as $c ){
echo mythemes_breadcrumbs::categories( absint( $c -> term_id ) );
break;
}
}
?>
<!-- the last arrow from path -->
<li></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<?php
}
?>
<!-- the content -->
<div id="main_content" class="content scrollspy">
<!-- the container ( align to center ) -->
<div class="container">
<div class="row">
<?php
global $post;
// get layout details
$mythemes_humanos_layout = new mythemes_humanos_layout( 'post' );
// left sidebar ( if exists )
$mythemes_humanos_layout -> sidebar( 'left' );
?>
<!-- the post -->
<section class="<?php echo $mythemes_humanos_layout -> classes(); ?>">
<?php
if( have_posts() ){
while( have_posts() ){
the_post();
?>
<article <?php post_class(); ?>>
<?php
// the post thumbnail
$p_thumbnail ;//= get_post( get_post_thumbnail_id( $post -> ID ) );
if( has_post_thumbnail( $post -> ID ) && isset( $p_thumbnail -> ID ) ){
?>
<!-- the post thumbanil wrapper -->
<div class="post-thumbnail overflow-wrapper">
<?php
// the post thumbnail
echo get_the_post_thumbnail( $post -> ID , 'mythemes-classic' , array(
'alt' => mythemes_post::title( $post -> ID, true )
));
// the post thumbnail caption
$c_thumbnail = isset( $p_thumbnail -> post_excerpt ) ? esc_html( $p_thumbnail -> post_excerpt ) : null;
if( !empty( $c_thumbnail ) ){
echo '<div class="valign-bottom-cell-wrapper">';
echo '<footer class="valign-cell">' . $c_thumbnail . '</footer>';
echo '</div>';
}
?>
</div><!-- .post-thumbnail -->
<?php
}
?>
<!-- the post title -->
<h1 class="post-title"><?php the_title(); ?></h1>
<!-- the post top meta: author / time / comments -->
<?php get_template_part( 'templates/meta/top' ); ?>
<!-- the post content wrapper -->
<div class="post-content">
<!-- the post content -->
<?php the_content(); ?>
<div class="clearfix"></div>
</div>
</article>
<?php
// the post pagination ( if exists )
wp_link_pages( array(
'before' => '<div class="mythemes-paged-post"><span class="mythemes-pagination-title">' . __( 'Pages', 'materialize' ) . ': </span>',
'after' => '<div class="clearfix"></div></div>',
'link_before' => '<span class="mythemes-pagination-item">',
'link_after' => '</span>'
));
?>
<?php
/**
*
* The template part for displaying bottom post meta
* If you want to override this in a child theme, then include a file
* called bottom.php and that will be used instead.
*/
get_template_part( 'templates/meta/bottom' );
?>
<!-- the post comments -->
<?php comments_template(); ?>
<?php
} // end of post
}
?>
</section>
<?php
// right sidebar ( if exists )
$mythemes_humanos_layout -> sidebar( 'right' );
?>
</div>
</div><!-- .container -->
</div><!-- .content -->
<?php get_footer(); ?>