Group posts by meta_key
This is the solution, according to the asker. He used the get() method of the WP_Query class to retrieve an array of values (colors), each stored with the meta key color. Because [color] => ‘Yellow’ may appear in the array more than once, he then filtered the array through the PHP function, array_unique() which will … Read more