-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
49 lines (43 loc) · 2.14 KB
/
single.php
File metadata and controls
49 lines (43 loc) · 2.14 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
<?php get_header(); while (have_posts()): the_post();
$post_ID = get_queried_object_ID();
$post_type = get_post_type($post_ID);
$post_title = get_the_title($post_ID);
$post_date = get_the_date('d F Y', $post_ID);
$post_categories = get_the_category($post_ID);
$post_image = get_the_post_thumbnail_url($post_ID, 'large');
$prev_post = get_next_post();
$next_post = get_previous_post(); ?>
<div class="single-<?php echo $post_type; ?>">
<div class="block-post-content">
<div class="block-setting-padding" style="--block-padding-top: 80px; --block-padding-bottom: 80px;">
<div class="container-sm">
<div class="post-header wysiwyg-content">
<?php if (!empty($post_date)): ?>
<h6><?php echo $post_date; ?></h6>
<?php endif; ?>
<h1><?php echo $post_title; ?></h1>
</div>
<div class="post-content wysiwyg-content">
<?php if (!empty($post_image)): ?>
<img class="image-landscape" src="<?php echo $post_image; ?>" alt="<?php echo $post_title; ?>">
<?php endif; ?>
<?php the_content(); ?>
</div>
<div class="post-footer flex-layout flex-align-center flex-justify-between flex-gap">
<div class="prev-post">
<?php if (!empty($prev_post)): ?>
<a href="<?php echo get_permalink($prev_post->ID); ?>" title="Previous post"><?php include_asset('icon-arrow-left.svg'); ?></a>
<?php endif; ?>
</div>
<?php include(get_template_directory().'/parts/social-share.php'); ?>
<div class="next-post">
<?php if (!empty($next_post)): ?>
<a href="<?php echo get_permalink($next_post->ID); ?>" title="Next post"><?php include_asset('icon-arrow-right.svg'); ?></a>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endwhile; get_footer();