-
Notifications
You must be signed in to change notification settings - Fork 1
/
single.php
72 lines (65 loc) · 2.54 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
<?php get_header();
while (have_posts()) {
the_post();
?>
<h2 class="page-heading"><?php the_title();?></h2>
<div id="post-container">
<section id="blogpost">
<div class="card">
<div class="card-meta-blogpost">
Posted by <?php the_author(); ?> on <?php the_time('F j, Y') ?>
<?php if(get_post_type() == 'post') { ?>
in <a href="#"><?php echo get_the_category_list(', ') ?></a>
<?php } ?>
</div>
<div class="card-image">
<img src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>"
alt="Card Image"> </div>
<div class="card-description">
<?php the_content(); ?>
</div>
</div>
<div id="comments-section">
<?php
$fields = array(
'author' =>
'<input placeholder="Name" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
'" size="30"' . $aria_req . ' />',
'email' =>
'<input placeholder="Email" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) .
'" size="30"' . $aria_req . ' />',
);
$args = array(
'title_reply' => 'Share Your Thoughts',
'fields' => $fields,
'comment_field' => '<textarea placeholder="Your Comment" id="comment" name="comment" cols="45" rows="8" aria-required="true">' .
'</textarea>',
'comment_notes_before' => '<p class="comment-notes">Your email address will not be published. All fields are required</p>'
);
comment_form($args);
$comments_number = get_comments_number();
if($comments_number != 0) {
?>
<div class="comments">
<h3>What others say</h3>
<ol>
<?php
$comments = get_comments(array(
'post_id' => $post-> ID,
'status' => 'approve'
));
wp_list_comments(array(
'per_page' => 15,
), $comments)
?>
</ol>
</div>
<?php } ?>
</div>
</section>
<?php } ?>
<aside id="sidebar">
<?php dynamic_sidebar('main_sidebar'); ?>
</aside>
</div>
<?php get_footer(); ?>