我有一个自定义循环:
<?php // Display the top ones
$args = array(
\'post_type\' => \'reply\',
\'post_parent\' => $post->ID,
\'r_sortby\' => \'highest_rated\',
\'r_orderby\' => \'desc\',
\'order\' => \'DESC\'
);
?>
<?php query_posts( $args ); ?>
<div class="entry-list-top">
<?php while ( have_posts() ) : the_post(); ?>
<h2 class="dark-title"><?php _e( \'Top Replies\' ); ?></h2>
<div class="topic-entry">
<div class="topic-author">
<?php bbp_reply_author_link( array( \'type\' => \'avatar\' ) ); ?>
</div>
<div class="topic-content">
<span class="topic-author-link"><?php bbp_reply_author_link( array( \'type\' => \'name\' ) ); ?></span>
<?php bbp_reply_admin_links(); ?>
<span class="topic-post-date"><?php printf( __( \'<span>%1$s</span> <span>at %2$s</span>\', \'bbpress\' ), get_the_date(), esc_attr( get_the_time() ) ); ?></span>
<?php bbp_reply_content(); ?>
<div class="tt-like-button">
<?php if(function_exists(\'the_ratings\')) { the_ratings(); } ?>
</div>
</div>
</div>
<?php $most_voted[] = get_the_ID(); // get the id of the most voted post ?>
<?php endwhile; ?>
我想检索帖子的数量(仅在此循环中)。(下面是另一个循环)。
有什么建议吗?