Skip to content

Instantly share code, notes, and snippets.

@rwkyyy
Created December 11, 2018 09:57
Show Gist options
  • Save rwkyyy/e022149949206faa2265acb01b69e604 to your computer and use it in GitHub Desktop.
Save rwkyyy/e022149949206faa2265acb01b69e604 to your computer and use it in GitHub Desktop.
change query of comments in wordpress (globally)
function rwk_change_query( $comments ) {
$comments->query_vars['order'] = 'DESC';
$comments->meta_query->parse_query_vars( $comments->query_vars );
}
add_action( 'pre_get_comments', 'rwk_change_query' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment