-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsingle-post.php
110 lines (82 loc) · 2.39 KB
/
single-post.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
<?php
get_header();
the_post();
// todo:
// add category button at top
// add date after title
?>
<article <?php post_class('single-post'); ?>>
<!-- Post title and breadcrumbs -->
<div class="post-header inside">
<?php
// Display link back to blog
?>
<div class="back-to-blog">
<a href="<?php echo esc_url( get_home_url() ); ?>" title="Back to blog" class="back-link button button-text button-blue button-small">
<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 13L1 7L7 1" stroke="#0957DE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span>Back</span>
</a>
</div>
<div class="wp-block wp-block-group is-layout-flex is-vertical is-content-justification-center">
<?php
// Display the first category
get_template_part('template-parts/post-category');
?>
<?php
// Breadcrumbs
// (Replaced with back link)
// echo gcm_get_yoast_breadcrumb_html();
?>
<?php
// Post Title
the_title( '<h1>', '</h1>' );
?>
<?php
// Display the date and read time
get_template_part('template-parts/post-date-read-time');
?>
</div>
</div>
<!-- Featured image -->
<?php if ( has_post_thumbnail() ): ?>
<div class="featured-image inside">
<?php the_post_thumbnail( 'large' ); ?>
</div>
<?php endif; ?>
<!-- Post content (blocks) -->
<div class="post-content inside">
<div class="is-root-container">
<?php the_content(); ?>
</div>
</div>
</article>
<!-- Related posts -->
<div class="gcm-related-posts is-root-container">
<div class="wp-block wp-block-group has-white-background-color has-background">
<div class="wp-block wp-block-group container-style-section is-layout-flex is-vertical gap-60 is-content-justification-left">
<h2><?php _e( 'Other articles', 'gcm' ); ?></h2>
<?php
$related_query = gcm_get_related_posts_query( get_the_ID() );
echo '<div class="archive-list">';
while ( $related_query->have_posts() ): $related_query->the_post();
get_template_part('template-parts/blog-post');
endwhile;
echo '</div>';
wp_reset_query();
?>
</div>
</div>
</div>
<!-- Testimonials -->
<div class="gcm-testimonials-slider is-root-container">
<?php
$post = get_post(4769);
setup_postdata($post);
the_content();
wp_reset_postdata();
?>
</div>
<?php
get_footer();