-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
139 lines (105 loc) · 5.03 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
<?php
get_header();
?>
<body class="custom-background">
<div class="site-wrapper">
<div id="loading-bar-wrapper">
<div id="loading-bar"></div>
</div>
<script>
document.getElementById("loading-bar").style.width = "20%"
document.getElementById("loading-bar").style.width = "40%"
</script>
<main id="main" class="clearfix">
<article id="" class="article white-box article-type-post" itemscope itemprop="blogPost">
<header class="article-header">
<h1 class="article-title" itemprop="name"><?php the_title(); ?></h1>
<?php
$get_theme_date_opt = get_theme_mod( 'article_shows_date' );
if ($get_theme_date_opt) { ?>
<div class="article-meta"><?php echo get_the_date('Y-m-d'); ?></div><?php } ?>
</header>
<?php
$featured_image = get_the_post_thumbnail_url(get_the_ID(), 'featuredImageFull');
?>
<?php if (get_the_tags()) :?>
<div class="article-tags">
<?php
$post_tags = get_the_tags();
if ($post_tags) {
foreach($post_tags as $tag) {
echo '<a href="'; echo bloginfo();
echo '/?tag=' . $tag->slug . '" class="tag-link">' . $tag->name . '</a>';
}
}
?>
</div>
<?php endif; ?>
<div class="featured-image">
<p align="center"><img height="30%" width="30%" class="featured-image" src="<?php echo $featured_image; ?>"></p>
</div>
<div class="article-entry" itemprop="articleBody">
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/post/content', get_post_format() );
the_content();
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
?>
<?php
$next_post = get_next_post();
$prev_post = get_previous_post();
if (!empty ($prev_post)): $prev_thumb = get_the_post_thumbnail_url($prev_post->ID);
?>
<div class="prev-next">
<span class="previous">
<ul class="post-list">
<li class="post-item grid-item" style="background-image: url(<?php echo $prev_thumb; ?>);">
<a class="post-link" href="<?php echo esc_url( get_permalink( $prev_post->ID ) ); ?>">
<h3 class="post-title"><?php echo esc_attr( $prev_post->post_title ); ?></h3>
<?php
$get_theme_date_opt = get_theme_mod( 'article_shows_date' );
if ($get_theme_date_opt) { ?><div class="post-meta"><?php echo esc_attr( $prev_post->post_date ); ?></div><?php } ?>
</a>
</li>
</ul>
</span>
<?php endif; ?>
<?php if (!empty( $next_post )): $next_thumb = get_the_post_thumbnail_url($next_post->ID); ?>
<span class="next">
<ul class="post-list">
<li class="post-item grid-item" style="background-image: url(<?php echo $next_thumb; ?>);">
<a class="post-link" href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>">
<h3 class="post-title"><?php echo esc_attr( $next_post->post_title ); ?></h3>
<?php
$get_theme_date_opt = get_theme_mod( 'article_shows_date' );
if ($get_theme_date_opt) {
?><div class="post-meta"><?php echo esc_attr( $next_post->post_date ); ?></div><?php } ?>
</a>
</li>
</ul>
</span>
<?php endif; ?>
</div>
</div>
</article>
<script>
document.getElementById("loading-bar").style.width = "60%"
</script>
</main>
<?php get_footer(); ?>
<script>
document.getElementById("loading-bar").style.width = "80%"
</script>
<div class="overlay"></div>
</div>
<?php
get_sidebar();
get_template_part( 'loader', get_post_format() );
?>
</body>
</html>