Ask automatic for each category?

5.45K viewsGeneral
0

I am planning on having a lot of categories, when on the ask page it has a huge list to choose the category.

Is there a way to integrate the Ask on the current page (current category) rather than moving away from the page?

Answered question
0

Please override list-head.php and replace

<?php ap_ask_btn(); ?>

to this:

global $question_category;
$ask_url = ap_get_link_to( 'ask' );
if( !empty( $question_category->term_id ) ) {
    $ask_url = $ask_url . '?category=' . $question_category->term_id;
}

echo '<a class="ap-btn-ask" href="' . $ask_url . '">' 
       . __( 'Ask question', 'anspress-question-answer' ) 
       . '</a>';

Cheers.

You are viewing 1 out of 3 answers, click here to view all answers.