-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathsingle.php
132 lines (124 loc) · 6.31 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
<?php
$alpha_layout_class = "col-md-8";
$alpha_text_class = "";
if ( ! is_active_sidebar( "sidebar-1" ) ) {
$alpha_layout_class = "col-md-10 offset-md-1";
$alpha_text_class = "text-center";
}
?>
<?php get_header(); ?>
<body <?php body_class( array( "first_class", "second_class" ) ); ?>>
<?php get_template_part( "/template-parts/common/hero" ); ?>
<div class="container">
<div class="row">
<div class="<?php echo $alpha_layout_class; ?>">
<div class="posts" <?php ?>>
<?php
while ( have_posts() ) :
the_post();
?>
<div <?php post_class( array( "first_class", "second_class" ) ); ?>>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="post-title <?php echo $alpha_text_class; ?>">
<?php the_title(); ?>
</h2>
<p class="<?php echo $alpha_text_class; ?>">
<em><?php the_author_posts_link(); ?></em><br/>
<?php echo get_the_date(); ?>
</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="slider">
<?php
if ( class_exists( 'Attachments' ) ) {
$attachments = new Attachments( 'slider' );
if ( $attachments->exist() ) {
while ( $attachment = $attachments->get() ) { ?>
<div>
<?php echo $attachments->image( 'large' ); ?>
</div>
<?php
}
}
}
?>
</div>
<div>
<?php
if ( !class_exists( 'Attachments' ) ) {
if ( has_post_thumbnail() ) {
$thumbnail_url = get_the_post_thumbnail_url( null, "large" );
printf( '<a class="popup" href="%s" data-featherlight="image">', $thumbnail_url );
the_post_thumbnail( "large", array( "class" => "img-fluid" ) );
echo '</a>';
}
}
the_content();
wp_link_pages();
?>
</div>
</div>
<div class="authorsection">
<div class="row">
<div class="col-md-2 authorimage">
<?php
echo get_avatar( get_the_author_meta( "ID" ) );
?>
</div>
<div class="col-md-10">
<h4>
<?php echo get_the_author_meta( "display_name" ); ?>
</h4>
<p>
<?php echo get_the_author_meta( "description" ); ?>
</p>
</div>
</div>
</div>
<?php if ( comments_open() ): ?>
<div class="col-md-12">
<?php
//comments_template();
?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php
endwhile;
?>
<div class="container post-pagination">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-8">
<?php
the_posts_pagination( array(
"screen_reader_text" => ' ',
"prev_text" => "New Posts",
"next_text" => "Old Posts"
) );
?>
</div>
</div>
</div>
</div>
</div>
<?php
if ( is_active_sidebar( "sidebar-1" ) ):
?>
<div class="col-md-4">
<?php
if ( is_active_sidebar( "sidebar-1" ) ) {
dynamic_sidebar( "sidebar-1" );
}
?>
</div>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>