-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
79 lines (64 loc) · 1.71 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
<?php
/**
* The template for displaying a post.
*
* @package wrdstudio
*
* @since 1.0.0
*/
namespace wrd;
the_post();
get_header();
?>
<article class="container grid gap-16 mt-16 mb-24">
<header>
<h1 class="text-4xl lg:text-5xl font-semibold mb-8">
<?php the_title(); ?>
</h1>
<div class="flex items-center gap-6">
<div class="rounded-full overflow-hidden bg-gray-100 dark:bg-gray-800">
<?php echo get_avatar( get_the_author_meta( 'ID' ), 64, '', get_the_author(), ); ?>
</div>
<div>
<div class="font-semibold"><?php the_author(); ?></div>
<div class="font-medium"><?php the_date(); ?></div>
</div>
</div>
</header>
<?php
the_post_thumbnail(
'xlarge',
array(
'loading' => 'eager',
'class' => 'w-full h-96 bg-gray-100 dark:bg-gray-800 object-cover object-center',
)
);
?>
<div class="grid lg:grid-cols-3 gap-x-16 gap-y-8">
<div class="col-span-2">
<div class="prose max-w-none mb-24">
<?php the_content(); ?>
</div>
<?php comments_template(); ?>
</div>
<aside>
<div class="sticky top-16">
<span class="hidden lg:block text-2xl font-semibold">
<?php the_title(); ?>
</span>
<div class="flex flex-wrap gap-10 mt-4">
<button data-share class="flex items-center gap-3 text-theme-500 font-semibold cursor-pointer" type="button">
<?php the_icon( 'share' ); ?>
<?php esc_html_e( 'Share', 'wrd' ); ?>
</button>
<a href="#comments" class="flex items-center gap-3 text-theme-500 font-semibold cursor-pointer">
<?php the_icon( 'chat_bubble' ); ?>
<?php echo esc_html( get_comments_number() . __( ' Comments', 'wrd' ) ); ?>
</a>
</div>
</div>
</aside>
</div>
</article>
<?php
get_footer();