如果值是字符串数组,则Worpdress元查询不起作用

我遇到了wordpress meta_query问题, 从这个简单的查询中我无法输出值:

(
[post_type] => offres
[meta_query] => Array
    (
        [0] => Array
            (
                [key] => topics
                [value] => Array
                    (
                        [0] => PADINE
                        [1] => ALKEKENGE
                    )

                [compare] => IN
            )

    )
)

这是php代码:

$args = array(
    'post_type' => 'offres', 'meta_query' => array(
        array(
             'key' => 'topics', 'value' => array('PADINE', 'ALKEKENGE'), 'compare' => 'IN'
         )
    )
);

在我的wordpress管理员上, 我有一个帖子分配了” topics”元键和” PADINE”作为值, 我不知道为什么它不起作用?

谢谢你的帮助。


#1


有时, 由于数据的序列化结构, 很难获得元值。

$args = array(
    'post_type' => 'offres', 'meta_query'    => array(
       'relation' => 'OR', array(
            'key'       => 'topics', 'value'     => 'PADINE', 'compare'   => 'LIKE', ), array(
            'key'       => 'topics', 'value'     => 'ALKEKENGE', 'compare'   => 'LIKE', )
    )
);

希望它能工作,

谢谢

来源:

https://www.srcmini02.com/66790.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_40316.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?