-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
61 lines (39 loc) · 1.62 KB
/
single.php
File metadata and controls
61 lines (39 loc) · 1.62 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
<?php get_header(); ?>
<main class="container">
<?php custom_breadcrumbs(); ?>
<?php if (have_posts()) :?><?php while(have_posts()) : the_post(); ?>
<article>
<h1 class="page-title"><?php the_title(); ?></h1>
<p class="post-date"><?php the_time('j M, Y') ?></p>
<?php the_content(esc_html__('Read More...', 'slug-theme'));?>
<div class="post-img">
<?php the_post_thumbnail('large', array('class' => 'img-res','alt' => get_the_title())); ?>
</div>
</article>
<?php endwhile; ?>
<?php else : ?>
<p><?php esc_html_e('Sorry, no posts matched your criteria.', 'slug-theme'); ?></p>
<?php endif; ?>
<div style="text-align: center" class="prev-post-post">
<?php
$previous_post = get_previous_post();
$next_post = get_next_post();
?>
<?php
if ($previous_post) {
$previous_link = get_permalink($previous_post);
echo '<a href="' . esc_url($previous_link) . '">Previous post</a>';
} else {
echo '<span>Previous post</span>';
}
echo ' <span class="divider-post">‒</span> ';
if ($next_post) {
$next_link = get_permalink($next_post);
echo '<a href="' . esc_url($next_link) . '">Next post</a>';
} else {
echo '<span>Next post</span>';
}
?>
</div>
</main>
<?php get_footer(); ?>