Hi, I need to display the answers in a question by their votes count, thus the higher voted answers get displayed first, and when the votes are changed, the order changes too.
Is this possible with DW QA? Thank you!
Hi mogita,
Please add the code below to wp-content/themes/your-theme-folder/functions.php
add_filter( 'dwqa_prepare_answers', 'dwqa_theme_order_answer_vote' ); function dwqa_theme_order_answer_vote( $args ) { $args['orderby'] = 'meta_value_num id'; $args['meta_key'] = '_dwqa_votes'; $args['order'] = 'DESC'; return $args; }
Thank you Kevin for such a fast response!
May I ask where should I find all available filters and such like “dwqa_prepare_answers”? I don’t see much detail in the “Support->Documentation” section. Anyway, thank you so much.
Hi Mogita,
We haven’t made the documentation for Developer yet, but we’re going to do it soon.
Hi Kevin, thanks for the info!
You’re welcome, my friend. Let me know if there is anything else I can help you with.
Yes there really is XD
I’m on a project that needs some customizations on DW QA, so if there’s a draft or some “alpha” versions of developer references, I’d like to get a copy, since the project is at hand and I found it hard to work all the way back to the plugin’s core codes.
If it’s not possible for now, I’ll still make my way thru the codes. XD
A big thanks in advance!
Hi Mogita,
You can contribute to the plugin with us on Github: https://github.com/designwall/dw-question-answer
This hides the Sort By dropdown. Is there any way to list the answers by votes AND keep the Sort By dropdown box?
Please login or Register to submit your answer