Ask automatic for each category?
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?
nathan zheng Answered question
Hi Rahul:
Thanks for your reply.
The error still exist. This is the full code:
div class="ap-list-head clearfix"> <div class="pull-right"> global $question_category; $ask_url = ap_get_link_to( 'ask' ); if( !empty( $question_category->term_id ) ) { $ask_url = $ask_url . '?form_question[category]=' . $question_category->term_id; } echo '<a class="ap-btn-ask" href="' . $ask_url . '">' . __( 'Ask question', 'anspress-question-answer' ) . '</a>'; </div>
nathan zheng Posted new comment
nathan zheng commented
Thanks Rahul.
I tried to add this code to functions.php in my child theme.
No luck, any other idea?
https://anspress.io/resources/faq/auto-select-current-category-from-single-category-while-asking/