The code to get the most popular question.

2.23K viewsWordPressAnspress anspress features
0

Hi,

The most popular question widget is available in anspress. But is there a code that will extract that will extract the most 5 important question?

I found this code for getting most popular question,

<?php
ap_get_questions(array(‘showposts’ => 5));
?>

<?php if ( ap_have_questions() ) : ?>
<div class=”ap-questions”>
<?php
/* Start the Loop */
while ( ap_questions() ) : ap_the_question();
ap_get_template_part(‘content-list’);
endwhile;
?>
</div>
<?php ap_questions_the_pagination(); ?>
<?php
else :
ap_get_template_part(‘content-none’);
endif;
?>

But the following code doesn’t seem to work anymore. Can anyone help me these?