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 1


You should ACF meta_query to filter custom post type by custom field.


basic example:

$posts = get_posts(array(
    'numberposts'   => -1,
    'post_type'     => 'products',
    'meta_key'      => 'price',
    'meta_value'    => $value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.