php - WP Job Manager - Orderby Customfield -


i'm using plugin wp job manager, , have custom field meta_key = rating.

i want able order listings rating , via short code "orderby".

normally posts imagine in funcitons.php:

$args = array(     'orderby'  => 'meta_value',     'meta_key' => 'rating',     'meta_query' => array(         array(             'key'     => 'rating',             'value'   => null,             'compare' => '!='          )      ), // end of meta_query     'fields'  => 'id',     'exclude' => array(         1     ),  ); 

anyone knows how this?

try adding functions.php:

function args_function_rating_dsaw($args) {     $args['orderby'] = 'meta_value_num';     $args['order'] = 'desc';     $args['meta_key'] = 'rating';     return $args; } 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -