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

How to get custom page template content showing in text or visual editor in Wordpress?

Apologies if this is a silly question, I have build out a wordpress theme from scratch but when checking the visual or text editor from the dashboard there is no content showing, which of course would be very useful, firstly for content to be updated directly from the dashboard, as well as for SEO content (Yoast claiming there is no content on the page). In my search for a solution one possibility was to declare at the top of the page php file, for example on my page-contact.php file:
<?php /* Template Name: page-contact */ ?> and then in the dashboard under page attributes to set the corresponding template (i.e. page-contact). No luck with this unfortunately. Then it seems that I need a loop on the page, but checking a page where I do have a loop there is still nothing in the editor. Be great if someone could help! Working through the Treehouse tuts I don't remember this being covered, although could be wrong! Regards, Nic

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Hey there! I might suggest checking out our WordPress Theme Development course for a bit more details on how to setup the custom pages and add in the Loop, both of which are likely necessary :)

thanks Zac, I'll go back to those, Regards, Nic