Title: Custom query syntax
Last modified: November 11, 2018

---

# Custom query syntax

 *  [theendfear](https://wordpress.org/support/users/theendfear/)
 * (@theendfear)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/custom-query-syntax/)
 * Is this syntax correct?
 *     ```
       function my_custom_query_wmlp($args, $shortcodeID){
         if ($shortcodeID == 3){
   
   
       	  $args = array(
         'post_status' => 'publish',
         'orderby'   => 'order_clause',
         'meta_query' => array(
              'order_clause' => array(
                   'key' => 'yasr_overall_rating',
                   'value' => 'overall_rating',
                   'type' => 'NUMERIC' 
       )));
   
           return $args;
         }
       }
       ```
   
    -  This topic was modified 7 years, 6 months ago by [theendfear](https://wordpress.org/support/users/theendfear/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [dudo](https://wordpress.org/support/users/dudo/)
 * (@dudo)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/custom-query-syntax/#post-10868639)
 * Hi, that rating are saved in the table postmeta with this meta key -> “yasr_overall_rating”
 * Best,
    Dario
 *  Thread Starter [theendfear](https://wordpress.org/support/users/theendfear/)
 * (@theendfear)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/custom-query-syntax/#post-10868720)
 * Ciao Dario, grazie per la risposta 🙂
    Sto cercando di usare il tuo plugin assieme
   a wp masonry layout per visualizzare i post ordinati a seconda dei voti degli
   utenti… però la query non mi genera nessun risultato. Sto cercando di ottenere
   i dati dalla tabella post meta attraverso meta query, è l’unico modo che ho (
   almeno credo, non sono un esperto) per filtrare la query di masonry seguendo 
   la documentazione del plugin: [https://www.masonrylayout.com/documentations/](https://www.masonrylayout.com/documentations/)
 *     ```
       'meta_query' => array(
              'order_clause' => array(
                   'key' => 'yasr_overall_rating',
                   'value' => 'overall_rating',
                   'type' => 'NUMERIC' 
       ```
   
 * La sintassi sembra giusta però non funziona… sapresti dirmi qualcosa in più?
   
   P.s ovviamente questa è una parte del codice, il codice completo è quello del
   primo post
    -  This reply was modified 7 years, 6 months ago by [theendfear](https://wordpress.org/support/users/theendfear/).
 *  Plugin Contributor [dudo](https://wordpress.org/support/users/dudo/)
 * (@dudo)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/custom-query-syntax/#post-10870935)
 * Please write me an email on free_support @ yetanotherstarsrating.com

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom query syntax’ is closed to new replies.

 * ![](https://ps.w.org/yet-another-stars-rating/assets/icon-256x256.png?rev=1525329)
 * [YASR - Yet Another Star Rating Plugin for WordPress](https://wordpress.org/plugins/yet-another-stars-rating/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yet-another-stars-rating/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yet-another-stars-rating/)
 * [Active Topics](https://wordpress.org/support/plugin/yet-another-stars-rating/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yet-another-stars-rating/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yet-another-stars-rating/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [dudo](https://wordpress.org/support/users/dudo/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/custom-query-syntax/#post-10870935)
 * Status: not resolved