Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress

Displaying Custom Posts and Fields in a Template

This is in reference to How to Build a WordPress Theme. I have problems with the chapter “Displaying Custom Posts and Fields in a Template.” The problem starts when I write the WP_Query and integrate the ($the_query) to the loop. The Work menu doesn’t show the titles of each of work post on the page. And the <hr> disappear at all. About, Blog and Contact menu works so far. I have tried to solve the problem from different ways but I failed. In fact, I did a carefully reviewed from the start tree times but I stopped there. Any suggestion how to solve it?

3 Answers

Tawny Bartlett
Tawny Bartlett
24,674 Points

Hi there. So just to understand where you are in the project, you've got a Page called Work which is displaying in the menu, but the page itself isn't showing your custom Work posts?

Have you 1 - Copied and pasted your page.php contents into work.php

2 - Created your work.php custom template and given it a Template Name

3 - Set the Work page to use this on the backend under Attributes > Template dropdown?

Otherwise are there any errors?

Thanks for your input. It's already resolved.