-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
71 lines (63 loc) · 2.67 KB
/
single.php
File metadata and controls
71 lines (63 loc) · 2.67 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
63
64
65
66
67
68
69
70
71
<?php
/**
* Single Post template.
*
* @package Edrea
*
* @version 1.0.0
* @copyright Copyright (c) 2023, Leonardo Doherty
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
global $post;
$author_id = $post->post_author;
$author_display_name = get_the_author_meta( 'display_name', $author_id );
$author_profile_image = get_avatar( $author_id, 30 );
$full_width = !is_active_sidebar( 'edrea-sidebar' ) ? 'edrea-full-width' : '';
get_header(); ?>
<main class="edrea-single-post edrea-main">
<div class="container">
<?php edrea_breadcrumbs_single_post(); ?>
<div class="edrea-single-post__wrapper">
<div class="edrea-single-post__wrapper--left <?php echo $full_width; ?>">
<h1 class="edrea-single-post__title"><?php echo get_the_title(); ?></h1>
<div class="edrea-single-post__meta">
<div class="edrea-single-post__meta--author">
<?php echo $author_profile_image; ?>
<p class="edrea-author-name"><?php echo $author_display_name; ?></p>
</div>
<div class="post-date">
<img src="<?php echo esc_attr__( get_template_directory_uri() . '/public/assets/icons/calendar.svg' , 'edrea' ); ?>" alt="<?php echo __( "Post date", 'edrea' ); ?>">
<p class="post-date"><?php echo get_the_date(); ?></p>
</div>
</div>
<?php echo the_content(); ?>
<?php if( get_the_tags() ) : ?>
<div class="edrea-tags">
<p>Tags: </p>
<div class="tag-list">
<?php foreach( get_the_tags() as $tag ) : ?>
<a href="<?php echo get_tag_link( $tag->term_id ); ?>"><?php echo $tag->name; ?></a>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<div class="edrea-social-sharer">
<?php echo get_template_part( '/utils/social-sharer' ); ?>
</div>
</div>
<?php if( is_active_sidebar( 'edrea-sidebar' ) ) : ?>
<div class="edrea-single-post__wrapper--right">
<?php get_sidebar(); ?>
</div>
<?php endif; ?>
</div>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
</div>
</main>
<?php get_footer(); ?>