Advertisement
5ally

Untitled

Mar 4th, 2019
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2. $comments = get_comments( array(
  3.     'post_status' => 'publish',
  4.     'meta_query'  => array(
  5.         'relation' => 'OR',
  6.         array(
  7.             'key'     => 'cld_like_count',
  8.             'compare' => 'EXISTS',
  9.         ),
  10.         array(
  11.             'key'     => 'cld_like_count',
  12.             'compare' => 'NOT EXISTS',
  13.         ),
  14.     ),
  15.     'orderby'     => 'meta_value_num',
  16.     'order'       => 'DESC',
  17. ) );
  18.  
  19. // Temporarily disable threaded (nested) comments.
  20. add_filter( 'option_thread_comments', '__return_false' );
  21.  
  22. wp_list_comments( array(
  23.     'callback' => 'listingo_comments',
  24. ), $comments );
  25.  
  26. // Now remove the above filter.
  27. remove_filter( 'option_thread_comments', '__return_false' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement