2015-06-16 14:56
浏览 72

Wordpress has_posts在静态页面主页中不起作用

I've got a problem with the function have_posts in my static page home... I would like to have a static page for my home but when I use have_posts in a loop, I don't have any posts but I have pages...

I don't understand what is going wrong...

Have you got an idea to fix that ?


图片转代码服务由CSDN问答提供 功能建议

我的静态页面主页中的函数 have_posts 出现问题。 我想为我的家有一个静态页面但是当我在循环中使用have_posts时,我没有任何帖子但是我有页面...

我不知道 了解出了什么问题......



  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongmian8108 2015-06-16 15:00

    The have_posts() on a static home page is to show the static home page.

    This function checks to see if the current WordPress query has any results to loop over. This is a boolean function, meaning it returns either TRUE or FALSE.

    So it checks if the query returns anything (pages,posts,custom content types).

    The have_posts() will return TRUE with 1 post(page) in it, the page you set as your static homepage.

    点赞 评论

相关推荐 更多相似问题