最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp query - get_posts function not returning any results

programmeradmin0浏览0评论

I'm currently working with WP and also using WPML. I'm trying to retrieve posts using the function get_posts but the function is not working. This is what I'm trying so far.

$posts = get_posts(array(
 'post_type' => 'location',
 'numberposts' => -1,
 'suppress_filters' => 0
));

As shown in the picture below I have many posts with the type of location.

I'm setting numberposts to -1 to get all the posts and also settings and also setting suppress_filters to 0 and also tried false. What should I try If I were to get all the posts for example es in spanish?

Even if I remove 'suppress_filters' => false, I still dont get any results back, althought there are many location posts.

发布评论

评论列表(0)

  1. 暂无评论