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!
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
Amanda Harris508 Points
Where are the original .php files located (or should be located) for my newly-created custom posts?
I am new to WP, and am just learning about custom posts. In the video, it shows the new .php files as being located in the original WP downloaded folder, under the child theme folder. I made the new post entitled "Art", but cannot locate this anywhere, either on my desktop, or on the Bluehost server. What did I do wrong, and what is the right way to create custom posts so that the .php files will appear in the correct location?
Amanda Harris508 Points
@Mark Christiansen, thanks for wording this question much better than I had. I also feel as if downloading the files from the video downloads would be skipping some important step, but for the sake of continuing, I'm going to use the downloaded files. I also followed along with the video, but I still don't see the files art.php, content-art.php, single-art.php.
@Sean T. Unwin, thanks for your response, though I'm not sure if I fully understand where those custom post files should be located; they are not in the folder (on the server or working directory) for the child theme I'm using, as it showed in the video.
Sean T. Unwin28,688 Points
If you have followed along with the video, you should have
art.php, content-art.php, single-art.php in your working directory and/or server. Following that you would have created an 'Art` page from within the WP Admin area and set it to the Art page template in the Page Attributes section.
If this is the part to which you are referring to then what you have just created in the admin area is stored in the database, not in a physical file on the server. It is using the template file, which is a physical file on the server, although the content of that page is stored within the database. I can understand how that can be confusing in the beginning.
So to recap:
Page templates are on the server
Pages which are created from within the admin area are stored in the database, similar to posts
- These pages are not part of your theme, which the physical files are -- the physical files are the templates
- These pages use either custom templates or if not Wordpress looks to use the
page.phptemplate to contain the contents of the page you created from within the admin.
I hope this helps to clear things up a little.
Hey @Sean T. Unwin,
Can I find these files without downloading them from the video downloads? Or would I have to custom the project downloads to fit different types of posts?