I have a platform in Wordpress
where a particular category has a Custom field.
Is it possible to display the posts in this category if they are sorted by the Custom field that I added?
I have a platform in Wordpress
where a particular category has a Custom field.
Is it possible to display the posts in this category if they are sorted by the Custom field that I added?
You need to use meta_key as an argument:
$args = array(
'order' => 'desc',
'meta_key' => 'prod_preco',
'orderby' => 'meta_value_num',
'post_status' => 'publish',
'post_type' => 'produtos',
);
$query = new WP_Query( $args );
...