1
我有一个WordPress评论模板的问题。如何按降序排列评论?
我想按降序排列评论。
我试图使用这段代码,但它没有奏效。
array ('order' => 'DESC')
注释模板:
<div class="wpcomments">
<?php if(comments_open()) : ?>
<div class="commentstyle">
<?php if(!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) : ?>
<?php die('You can not access this page directly!'); ?>
<?php endif; ?>
<?php if(!empty($post->post_password)) : ?>
<?php if($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
<p>This post is password protected. Enter the password to view comments.</p>
<?php endif; ?>
<?php endif; ?>
<?php if($comments) : ?>
<ol>
<?php foreach($comments as $comment) : ?>
<li id="comment-<?php comment_ID(); ?>">
<div class="commentw">
<?php if ($comment->comment_approved == '0') : ?>
<p></p>
<?php endif; ?>
<div class="comment-avatar"></div>
<div class="comment-left"><b><?php comment_author_link(); ?></b> (<?php comment_date(); ?> <?php comment_time(); ?>)
<div class="comment-below">
<?php comment_text(); ?>
</div>
</div>
</div>
</li>
<?php endforeach; ?>
</ol>
<?php else : ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
你在哪里试图把这些代码(数组)? –