custom post types - Meta Query Not Returning Output Despite Having Matching Values

admin2025-06-02  1

I am formulating a query to pull from a custom post type, with values matching a custom field. The results are blank although I have 3 values set matching the custom field.

Is my query formulated properly?

My query is:

$turtleposts = array('post_type' => 'turtle', 
                                       'posts_per_page' => -1,
                                       'meta_query' => array(
                                            array(
                                              'key' => 'derby',
                                              'value' => 'Yes',
                                              'compare' => '='
                                            ),                                                
                                        ),
                                       'orderby' => 'meta_value',
                                       'meta_key' => 'name',
                                       'order' => 'ASC');
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748802533a313843.html

最新回复(0)