• Доброго времени суток! Вывожу на главную страницу новые темы с помощью плагина Shorcodes Ultimate и хочу вывести числом количество ответов в теме, но все время пишет, что 0. Использовала функции bbp_get_topic_reply_count и подобные с reply count — всё тщетно. Сайт seloru.com Стандартными функциями вывода комментариев от WP — тоже не получается. Использую такой вот код для вывода:

    
    <div class="su-posts su-posts-default-loop">
    	<?php
    		// Posts are found
    		if ( $posts->have_posts() ) {
    			while ( $posts->have_posts() ) :
    				$posts->the_post();
    				global $post;
                	?>
    				<div id="su-post-<?php the_ID(); ?>" class="su-post">
    <?php if ( has_post_thumbnail() ) : ?>
    <a>"><?php the_post_thumbnail(); ?></a>
    		<?php endif; ?> 
    <h2 class="su-post-title"><a>"><?php the_title(); ?></a></h2>   
             <div style="float:right !important; padding-bottom:20px;"><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>   <br>          
       /*вывод тем*/
    <div class="su-post-content">
                                                  <?php  the_excerpt() ?>
                            <p style="text-align:center"><img />" alt="<?php the_title(); ?>" style="max-width:800px"/><p>
                         <?php   get_template_part(‘content’,’single’);?>
    <!--						 <?php the_content('<span style="text-decoration: underline;font-weight:400;"> Читать дальше &raquo; </span>'); ?> -->
    					</div>
                        
    					<p class="su-post-comments-link" >
                            <img src="/wp-content/uploads/2016/10/users.png" width="16" /> <span class="hover2" ><?php the_author_posts_link(); ?></span>  <img src="/wp-content/uploads/2016/10/arrow_right.png" width="16" /><span class="hover2" ><?php the_taxonomies(array('template' => '% %l')); ?></span><img src="/wp-content/uploads/2016/10/calendar.png" width="16" /> <?php _e( '', 'shortcodes-ultimate' ); ?> <?php the_time( get_option( 'date_format' ) ); ?>
    
    /*вывод комментариев, пишет всегда "нет комментариев", заменила на просто "Комментарии", чтобы не бросалось в глаза*/ 
                            <img src="/wp-content/uploads/2016/10/comm.png" width="16" /><span class="hover2"><a>" ><?php comments_number( __( 'Комментарии', 'shortcodes-ultimate' ), __( '1 comment', 'shortcodes-ultimate' ), '% comments' ); ?></a></span> 
                    
    <!--
                    <?php bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count(); ?>
                           
    <?php echo esc_html( $stats['reply_count'] ); ?>
    -->
    
                        
    				</div>
    
    				<?php
    			endwhile;
    		}
    		// Posts not found
    		else {
    			echo '<h4>' . __( 'Posts not found', 'shortcodes-ultimate' ) . '</h4>';
    		}
    	?>
    </div>
    
  • Тема «Вывод количества комментариев из темы в BBPress» закрыта для новых ответов.