admin管理员组文章数量:1130349
This question is addition to the following question.
The answers to the linked question say that you have to write THE LOOP inside each php template file, but what is still open is WHY? why is it necessary to write is as part of page.php if this page is not supposed to display any post at all?
another question why when I perform have_posts() inside page.php the return value is 'true'? shouldn't it contain no posts at all in this page?
This question is addition to the following question.
The answers to the linked question say that you have to write THE LOOP inside each php template file, but what is still open is WHY? why is it necessary to write is as part of page.php if this page is not supposed to display any post at all?
another question why when I perform have_posts() inside page.php the return value is 'true'? shouldn't it contain no posts at all in this page?
Share Improve this question asked Oct 31, 2018 at 13:01 GyRoGyRo 1355 bronze badges 1- A page is a type of post. – Milo Commented Oct 31, 2018 at 13:21
1 Answer
Reset to default 3The wording is (for historical reasons) a bit confusing. Actually Post can mean two things in WordPress:
- The literal Post as in Blog-Post
- A general term encompassing other default Post Types (like e.g. Pages) or Custom Post Types.
So there is the Post Type "post" just like there is the Post Type "page".
Here is a link to the Codex which elaborates on that a bit more: https://codex.wordpress/Post_Types
This question is addition to the following question.
The answers to the linked question say that you have to write THE LOOP inside each php template file, but what is still open is WHY? why is it necessary to write is as part of page.php if this page is not supposed to display any post at all?
another question why when I perform have_posts() inside page.php the return value is 'true'? shouldn't it contain no posts at all in this page?
This question is addition to the following question.
The answers to the linked question say that you have to write THE LOOP inside each php template file, but what is still open is WHY? why is it necessary to write is as part of page.php if this page is not supposed to display any post at all?
another question why when I perform have_posts() inside page.php the return value is 'true'? shouldn't it contain no posts at all in this page?
Share Improve this question asked Oct 31, 2018 at 13:01 GyRoGyRo 1355 bronze badges 1- A page is a type of post. – Milo Commented Oct 31, 2018 at 13:21
1 Answer
Reset to default 3The wording is (for historical reasons) a bit confusing. Actually Post can mean two things in WordPress:
- The literal Post as in Blog-Post
- A general term encompassing other default Post Types (like e.g. Pages) or Custom Post Types.
So there is the Post Type "post" just like there is the Post Type "page".
Here is a link to the Codex which elaborates on that a bit more: https://codex.wordpress/Post_Types
本文标签: postsWhy do I need to use The Loop on pages (inside pagephp etc)
版权声明:本文标题:posts - Why do I need to use The Loop on pages (inside page.php etc)? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749217299a2334372.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论