admin管理员组文章数量:1424963
I have a couple of custom pages in WordPress. How do I tell my page to get me only the posts I assign (if I could assign) to that page? Is there a way to tell posts whose page they are for?
I have a couple of custom pages in WordPress. How do I tell my page to get me only the posts I assign (if I could assign) to that page? Is there a way to tell posts whose page they are for?
Share Improve this question edited Jun 2, 2019 at 17:36 butlerblog 5,1313 gold badges28 silver badges44 bronze badges asked Jun 2, 2019 at 15:34 EliEli 112 bronze badges 2- 1 I don't have the full picture, but the correct way to do this probably wouldn't be with pages. Instead you should assign the post to categories, and then provide custom templates for those categories. – Jacob Peattie Commented Jun 2, 2019 at 16:03
- @butlerblog This type of edition should not be made from the Low Quality Posts queue. – nmr Commented Jun 3, 2019 at 8:19
1 Answer
Reset to default 0If you write code...
Step 1. Find and edit every post you want to assign to a page and give them all either: 1) The same Category, 2) The same Tag or 3) The same post metadata
Step 2. On that page's template or in a custom block or widget write a WP_Query that gets the posts (by tag, category or post meta) and displays them on the page in the format you want.
There are other solutions and even more if you are not a developer but that is the solution I think is the easiest if you know how to write code.
本文标签: How to select what posts goes into which custom page template
版权声明:本文标题:How to select what posts goes into which custom page template? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745440213a2658412.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论