I have custom post-type for products (with AFC filed price) I don´t have WooCommerce installed. But I would like to sort my products by price in a price filter. Any ideas how can I achieve that or someone can point me in right direction?
1 Answer
You should ACF
meta_query to filter custom post type by custom field.
https://www.advancedcustomfields.com/resources/query-posts-custom-fields/
basic example:
$posts = get_posts(array(
'numberposts' => -1,
'post_type' => 'products',
'meta_key' => 'price',
'meta_value' => $value
));