I see there is a sort option. How can I make sort by “Votes” the default?
1 Answers
Hi John Murphy,
Please add the code below to wp-content/themes/your-theme-folder/functions.php
add_filter( 'dwqa_prepare_archive_posts', 'dwqa_theme_sort_question_by_vote' ); function dwqa_theme_sort_question_by_vote( $args ) { $args['orderby'] = 'meta_value_num'; $args['meta_key'] = '_dwqa_votes'; return $args; }
Perfect Thanks!
Please login or Register to submit your answer