Wordpress高级分类法查询与自定义字段(日期类型)排序

时间:2016-10-07 20:56:01

标签: wordpress

这是我最终构建的高级分类法查询数组。

但它返回0个帖子。

如果我删除了项目([orderby] => meta_value_num),那么我会收到帖子,但根本不考虑查询中的自定义字段。

我做错了什么?

 [posts_per_page] => 6
    [order] => DESC
    [ignore_sticky_posts] => 1
    [orderby] => meta_value_num
    [meta_key] => wpcf-sort-order
    [tax_query] => Array
        (
            [relation] => AND
            [0] => Array
                (
                    [taxonomy] => category
                    [field] => slug
                    [terms] => Array
                        (
                            [0] => featured
                        )

                    [operator] => AND
                    [include_children] => 1
                )

            [1] => Array
                (
                    [taxonomy] => category
                    [field] => slug
                    [terms] => Array
                        (
                            [0] => politics
                            [1] => science
                        )

                    [operator] => IN
                    [include_children] => 1
                )

        )

    [paged] => 1
)

自定义字段以此格式存储日期:1475773260

0 个答案:

没有答案