admin管理员组文章数量:1315368
I'm new to the Wordpress world. I've read the template hierarchy document and read online, but, I wanted to get feedback from here on what the best way to do this would be.
What I'm trying to do is create a page that simply lists all of the posts that my site has. I am creating my own theme and as a result the home page (front-page.php) is highly tweaked. I do list recent posts, but, only their titles. On my home page I would like to add a link to "See all blog posts". I'm comfortable with the PHP code; I know how to display posts. I'm just not sure what the best way to get a page that lists them all aside from the homepage is.
I'm sure this is very easy to accomplish, I'm just still working through the Wordpress structure so your advice is appreciated!
I'm new to the Wordpress world. I've read the template hierarchy document and read online, but, I wanted to get feedback from here on what the best way to do this would be.
What I'm trying to do is create a page that simply lists all of the posts that my site has. I am creating my own theme and as a result the home page (front-page.php) is highly tweaked. I do list recent posts, but, only their titles. On my home page I would like to add a link to "See all blog posts". I'm comfortable with the PHP code; I know how to display posts. I'm just not sure what the best way to get a page that lists them all aside from the homepage is.
I'm sure this is very easy to accomplish, I'm just still working through the Wordpress structure so your advice is appreciated!
Share Improve this question asked Dec 14, 2012 at 16:51 Justin HelgersonJustin Helgerson 1291 gold badge1 silver badge10 bronze badges 1 |2 Answers
Reset to default 1You have to create a page template with Loop inside. Then create a page "All My Posts" and assign the template you've created to it in "Page Attributes" section of "Edit Page" admin page.
You can link to this page from the Front Page using get_page
function. Function Reference/get page.
I know this question was answered years ago, but for those looking for a solution that find this page, there is a MUCH easier solution.
- Go to Posts > Categories and click on Quickedit for the default blog category called Uncategorized.
- Rename Uncategorized to Blog and change the slug to blog.
- Then, when you create new categories, select Blog as the parent category. (You can easily Edit existing categories to make them children of the Blog category also.)
- Last, in Appearances > Menu, click on Categories and click on Blog to add it to your menu.
Now all new posts will automatically be in the blog category by default, or one of it's child categories, and all will show in one page (paginating to older posts after a certain number of posts most likely).
As an extra bonus, your blog posts are all now accessible at yoursite/category/blog
本文标签: linksLinking to page with all posts
版权声明:本文标题:links - Linking to page with all posts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741975750a2408110.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
blog template
(by this tutorial: "Blog Posts" template) and then publish. Happy coding. :) – Mayeenul Islam Commented Dec 15, 2012 at 5:28