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 edit the PHP file for Posts

I hired a web developer to change the default appearance of a Post to modify the placement of text/images and content. I know a little PHP and HTML and wanted to change the template myself, but I don't know what file to edit.

Where might the template file that handles posts be located?

3 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Check the single.php file :)

It's possible there may be an include call to yet another file within that file, but the single.php page controls what a single blog post page looks like.

It's difficult to answer this question without a deeper understanding of your setup. I'm happy to jump on a screen share session with you to figure this out — feel free to add me on Screenhero (http://screenhero.com) — I'm jcodehelp@gmail.com on Screenhero.

Matt Campbell
Matt Campbell
9,767 Points

Anything more than CSS changes via a child theme is risky as, if the theme is updated, you'll lose the changes you've made.

Either way, you need to look in wp-content/themes/nameoftheme.

There will be all your templates. What you're going to want to look for is single.php or "custom-post-type"-single.php, possibly, and I wouldn't expect it, page.php.

They're the files that will control posts being displayed.