answer count issue in question

3.52K viewsIssues
0

Hi,

I am working with Anspress and an Askbug-child and I have a problem with the count of answers displayed in the header of the question which is blocked on 1. This must come from the following code ($ans_count and 3rd echo)

<?php
	$ans_count 		= ap_question_get_the_answer_count();
	$last_active 	= ap_question_get_the_active_ago();
	$total_subs 	= ap_question_get_the_subscriber_count();
	$view_count 	= ap_question_get_the_view_count();
	$last_active_time = ap_human_time( mysql2date( 'G', $last_active ) );

	echo '<span class="ap-display-meta-item"><span class="stat-label apicon-pulse"></span><span class="stat-value"><time class="published updated" itemprop="dateModified" datetime="'.mysql2date( 'c', $last_active ).'">'.$last_active_time.'</time></span></span>' ;
	echo '<span class="ap-display-meta-item"><span class="stat-label apicon-eye"></span><span class="stat-value">'.sprintf( _n( 'One time', '%d times', $view_count, 'anspress-question-answer' ), $view_count ).'</span></span>' ;
	echo '<span class="ap-display-meta-item"><span class="stat-label apicon-answer"></span><span class="stat-value">'.sprintf( _n( '%2$s1%3$s answer', '%2$s%1$d%3$s answers', $ans_count, 'anspress-question-answer' ), $ans_count, '<span data-view="answer_count">', '</span>' ).'</span></span>' ;
	echo '<span class="ap-display-meta-item"><span class="stat-label apicon-users"></span><span class="stat-value">'.sprintf( _n( '1 follower', '%d followers', $total_subs, 'anspress-question-answer' ), $total_subs ).'</span></span>' ;
?>

Please note that the count of answers displayed below the question (on top of the answers list, shown herebelow) is working properly;

<?php printf(
	_n('%s%d%s answer', '%s%d%s answers', ap_answer_get_the_count(), 'anspress-question-answer'),
	'<span data-view="answer_count">',
	ap_answer_get_the_count(),
	'</span>'
	);
?>				

Could you please help me adapt the first code?

Many thanks in advance for your help,

Sincerely,

Thierry