У меня есть файл single.php и я m showing single post in it. I want to show comments on related to this post under this post. But the problem is I
m получает комментарии ко всем комментариям ниже любого сообщения.Показать комментарии к сообщению ниже сообщения в single.php wordpress
Ниже мой single.php код
<?php
/*
* The template for displaying all single posts and attachments
*/
?>
<?php get_header(); ?>
<div id="single_post_wrap">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<div class="time_and_author"><?php the_time('F jS, Y') ?> by <?php the_author() ?></div>
<div class="post_content"><?php the_content(); ?></div>
<p>Posted in <?php the_category(', ') ?> | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
<?php endwhile; endif; ?>
<?php foreach (get_comments() as $comment): ?>
<div><?php echo $comment->comment_author; ?> said: "<?php echo $comment->comment_content; ?>".</div>
<?php endforeach; ?>
<?php comments_template(); ?>
</div>
</div>
<?php get_footer(); ?>
Ниже мой comments.php код
<?php $comment_args = array(
'comment_notes_after' => '',
'title_reply' => 'Have something to say?'
) ?>
Спасибо заранее.
Давая мне такой же результат, как мой код. @jogesh_pi –