Try to search your question here, if you can't find : Ask Any Question Now ?

How to display specifik product variants

HomeCategory: stackoverflowHow to display specifik product variants
Avatarbhawya asked 1 week ago

I’m trying to display all product variants with a specific attribute.
E.g. all the t-shirts which are blue.

I’m trying to use this code, but it doesn’t seem to filter based on the key and value input.
Do I have to do more than this or is it not possible to be doing it this way?

$meta_query_args = array(
    'relation' => 'OR',
        'key'     => 'Custom_Attribute',
        'value'   => 'Color',
        'compare' => '='
$meta_query = new WP_Meta_Query( $meta_query_args );
1 Answers
Best Answer
AvatarAmit answered 1 week ago
Your Answer

12 + 0 =

Popular Tags

WP Facebook Auto Publish Powered By :