You can simply limit the query to return only one result. To achieve this, use the field posts_per_page
in your query arguments. Check the documentation for more info on this.
$args = [
'cat' => '44',
'posts_per_page' => '16',
'post_type' => 'post',
'post_status' => 'publish',
'meta_query' => [
'metavalue1' => [
'key' => 'Meta_value',
'value' => '',
'compare' => '!='
],
'price1'=> [
'key' => 'price_euro',
'value' => '30',
'compare' => '>',
'type' => 'NUMERIC'
],
],
'orderby' => 'price1',
'order' => 'ASC',
'posts_per_page' => 1,
];
$wp_query = new WP_Query($args);
Sidenote: To make your code more readable, try to stick to one thing. Using short array syntax ([ ]
) somewhere? -> Use it everywhere and avoid array()
. Using 'key' => 'value'
? Don’t use 'key'=>'value'
somewhere else.