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

PHP How to Build a WordPress Theme Converting Static HTML into WordPress Templates The Category Template

Don Shipley
Don Shipley
19,488 Points

Wordpress Category Template

Following this series after doing the save as from the home.php to category.php the site does not read the category.php nor as shown in the video does it read the index.php. Reads the home.php and the content-post.php. Not sure what I am doing wrong.

2 Answers

Peter Mumford
Peter Mumford
7,774 Points

I have not completed that course, but I have made a lot of WordPress themes.

Its sometimes hard to determine which template WordPress is loading. I will put in a temporary <h3>category template</h3> line in my category.php file. If I see that heading, I am sure I'm editing the right file. Then I remove the heading of course.

Also, do you know that the category.php does not display single posts? It is only for listings of posts in a particular category. for single posts you need single.php.

Don Shipley
Don Shipley
19,488 Points

Thank you for your reply, I am watching the videos now for a third time so I may learn more. I need to study more on the php and also the wordpress. On a site I built using html, css and php converting it to a wordpress it did not read the css files correctly for wordpress name my ul li which I used in my nav. Have to rename to match wordpress.

If you would like to suggest the direction best to learn the coding for wordpress and php that would be really helpful.

Thank you

Don Shipley
Don Shipley
19,488 Points

In your opinion should I learn more than the basics of php prior to learning the wordpress codex?

Peter Mumford
Peter Mumford
7,774 Points

Well it depends what your goal is. If you just want to build custom wordpress themes, and make websites similar to the WP default, you can start theming and solve problems by looking them up in the WP codex.

If you want to be a developer who can write plugins and custom functions, you will need to learn php. I started studying php after I'd already made lots of custom themes, and already knew WordPress pretty well.

Don Shipley
Don Shipley
19,488 Points

Thank you for your reply. I am kinda doing both. Have built a site using underscores.me works pretty well just added a custom css file. But built the pages on it using html on the pages. Not the way to go but worked. This has been a good series Learning some of the basics of the wordpress codex. Guess I will have to read a lot more of the codex. Will continue to learn more on php as well.