Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP How to Build a WordPress Theme Converting Static HTML into WordPress Templates Convert Blog Listing and Single Post Templates

Christie Parkhurst
Christie Parkhurst
6,059 Points

Blog posts aren't showing

I have blog posts, but they are not showing up in my site. When I click on the blog link in the menu in the frontend, it goes to /blog-3. If I put just "blog" in the url, it redirects to blog-3. I'm not sure if that is the problem, or something is wrong in the templates.

2 Answers

I would have to see the code on the template to say for sure, but you can change your permalinks in the back end to settings -> permalinks. That would cause the URL to give you a little more information and hopefully isolate the problem. You could also check the urls in the menu on the back end.

If that doesn't help, post the template code and I'll take a look.

Good luck!

Christie Parkhurst
Christie Parkhurst
6,059 Points

Thanks for your help. I checked into the permalinks, which led to me to check into the blog page I created in the admin. It turns out I could just change the url right there. But that didn't make my posts appear. I found in this article http://codex.wordpress.org/Creating_a_Static_Front_Page that I had never assigned the posts to show on the blog page from admin. Once I followed these steps, which I will put here in case anyone else in the future needs them, my posts showed, with no editing done to the home.php template at all. Here are the steps:

Go to Administration > Settings > Reading panel.

  1. Set Front page displays to a static page
  2. In the drop down menu for Front Page select "Home."
  3. In the drop down menu for Posts page select "Blog" or the name you created, or leave it blank if you will not feature posts on the site.
  4. Save changes.

This is probably a basic step in setting up a site, but I'm new to this, and missed it somehow.