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

WordPress

Jeremy Frimond
Jeremy Frimond
14,470 Points

custom page posts keep routing to index.php instead of single-custom_page.php

I have a page called employees.php. I have created a single-employees.php page too.

When I click on a link on the employees.php i expect to go to the single-employees.php page however I keep getting routed to the index.php page. Any ideas how to get it to see the single-employees.php page?

Additionally, If click on "view post" in the wordpress admin area it also links me to the index.php page

Cheers

2 Answers

Kevin Korte
Kevin Korte
28,149 Points

I'm assuming that your employees list is coming from a custom post type called employees?

Jeremy Frimond
Jeremy Frimond
14,470 Points

Kevin Korte I figured it out thanks. I had the single page file titled single-employees when the singular label in the custom post type sections in the admin area was employee (without the "s")

Kevin Korte
Kevin Korte
28,149 Points

Awesome. We've all been there before!