• 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.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor dudo

    (@dudo)

    Hi, that rating are saved in the table postmeta with this meta key -> “yasr_overall_rating”

    Best,
    Dario

    Thread Starter theendfear

    (@theendfear)

    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/

    '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.
    Plugin Contributor dudo

    (@dudo)

    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.