-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
62 lines (62 loc) · 2.82 KB
/
single.php
File metadata and controls
62 lines (62 loc) · 2.82 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
<?php get_header(); ?>
<?php
if (have_posts()) :
while (have_posts()) :
the_post();
global $post;
?>
<div class="page"
style="background-image: linear-gradient(rgba(2, 8, 21, 0.9), rgba(2, 8, 21, 0.8)), url(<?php echo esc_url(get_theme_mod('background_image_setting', get_template_directory_uri() . '/assets/img/banner1.jpg')); ?>)">
<div class="page__header">
<h1 class="page__title animate__animated animate__zoomIn"><?php the_title(); ?></h1>
</div>
<p class="page__share">Share this</p>
<div class="page__icons">
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink() ?>" class="page__icon"
target="_blank"><i class="bi bi-facebook"></i></a>
<a href="http://www.twitter.com/share?url=<?php the_permalink() ?>" class="page__icon" target="_blank"><i
class="bi bi-twitter-x"></i></a>
<a href="whatsapp://send?text=<?php the_permalink() ?>" class="page__icon" target="_blank"><i
class="bi bi-whatsapp"></i></a>
</div>
</div>
<div class="section">
<div class="article__content">
<div class="section__title single__title animate__animated animate__fadeIn">
<h1 class="heading-1 color-gold single-heading"><?php the_title(); ?></h1>
<span class="dash"></span>
<span><span class="color-gold single__category"><?php the_category(', '); ?></span> | <span
class="color-grey">Published:
</span> <span class="color-gold"><?php the_time('d M y'); ?></span></span>
</div>
<?php the_content(); ?>
</div>
</div>
<?php
endwhile;
else : ?>
<section class="section">
<p class="not-found__text">Sorry, no post found!</p>
</section>
<?php
endif;
?>
<section class="section single__pagination">
<div class="article__content">
<div class="d-flex justify-content-between align-items-center">
<?php
$prev_post = get_previous_post();
$next_post = get_next_post();
?>
<?php if (! empty($prev_post)) : ?>
<a href="<?php echo get_permalink($prev_post->ID); ?>" class="post-nav__link prev color-gold fw-bold">←
Previous</a>
<?php endif; ?>
<?php if (! empty($next_post)) : ?>
<a href="<?php echo get_permalink($next_post->ID); ?>" class="post-nav__link next color-gold fw-bold">Next
→</a>
<?php endif; ?>
</div>
</div>
</section>
<?php get_footer(); ?>