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

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.