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!
You 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.
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.com/category/blog