I’m working with a WordPress CMS website that was set up without a blog. I want the site to continue to function as it has, with mostly static pages, including the home page. I want a page called “Blog” to function as a blog.
Now I’ve been asked to add a blog, and what I expected would be extremely easy isn’t turning out that way.
This is what I’ve tried:
- Added a page called “Blog” and published it.
- Under Settings >> Reading, set the Posts
page to Blog. (A Static Page is selected, with Front Page set to
“Home”.) - Added Blog to the main navigation in the Theme Options.
- Created 2 posts.
When I view the Blog page, two messages appear instead of the two blog posts:
Please go to Admin Panel > Settings > Reading and setup "Front page displays" option
Another detail that may be relevant is there are only 2 page templates: Default Template and Archives. If I select Archives as the template for Blog, I get an archive menu that links to the 2 posts I set up.
Should I have a Blog Template as well? How can I add one? What else should I look at?
So, everything seems to be set up correctly. The setting in your step 2 is everything that needs to be done. I won’t be able to help you without seeing how the theme’s template files are structured.
The way it usually works when you apply the setting in your step 2 is that WordPress looks for a template called front-page.php, if it doesn’t exist then WordPress uses index.php.
Now, one of these templates must use the regular post loop, that is
I assume that this loop is not present in your index.php or front-page.php files, and this is why your posts are not showing.
Pogoking’s answer helped point me in the right direction, but didn’t solve the problem. This is what I ended up doing.
I created a new template within the customized theme we are using and edited the blog page to use the new template.
I added the loop to the new template along with a query with a few parameters. I’m sure I’ll modify the template substantially, but it works for now. All blog posts are displayed as I want them to.
Here is my code: