retlehs/roots — Issue #160: Blog on a Page
Author: gregpettit
Created: 2011-10-30 07:00:40+00:00
State: open

I'm not sure this is the best place to ask (more of a forum question than an issue), but could someone direct me to the best practice for putting a blog as a "page" within a Roots-based deployment?

I've successfully made a blog with the main (front) page, because when you flip the switch in the Reading options, everything mostly falls into place. However, I'm a bit stuck for doing it any other way. Here's what I've done so far:

1. Cloned index.php and added the necessary comment to turn it into a page template.
2. Created some sample posts
3. Created a page that uses the BlogHome template, and visited it.

result: The formatting of the "post" was as expected (title, byline with date, etc), but the WP query was for the current page. In other words, my page is called "Blog" and has some sample text; when loading the page I see the title "Blog" and the sample text (under the byline), when I was hoping to see my posts.

4. Dropped the "index" from the template part line; I assumed this meant it would call loop.php for its loop (according to the docs, this should be the correct loop for my purposes)

result: no change

5. Tried adding a query, using both query_posts() and new WP_query() methods, specifying to query for post type "post"

result: no change

I feel like I'm overlooking something obvious! I can't help wondering if #5 was the answer and I just did it wrong or something. Not sure why the loop is grabbing the current page instead of the query I've specified.

Thanks!