Answers for "wp query wordpress get order by meta key and value"

PHP
1

get post order by meta value int

$defaults = array(
  	'numberposts'      => -1,
	'post_type'        => 'agent_listing',
  	'meta_key'	       => 'oepl_order_no',
  	'orderby'          => 'meta_value_num',
  	'order'            => 'ASC',
  	'suppress_filters' => false
);

'orderby' => 'meta_value_num', // for int field
'orderby' => 'meta_value', // text field
Posted by: Guest on September-01-2020

Code answers related to "wp query wordpress get order by meta key and value"

Browse Popular Code Answers by Language