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

Eric Huang
Eric Huang
5,318 Points

How to change single.php parent?

Hello,

I've completed the how to create wordpress theme section and I don't know how to deal with breadcrumb path.

When I go into single-work.php and install yoast breadcrumb plugin, the path will show : home >> blog >> name-of-the-post. Then when I click the blog, it will direct me to blog post (which I don't want and doesn't make sense). My question is how to make the path to be home >> work >> name-of-the-post?

I've tried anything to no avail. Please help.

Thanks in advance :)

Zachary Dahan
Zachary Dahan
2,392 Points

There's is a solution but she is too dirty and longer so I'll not prononce it.

But why did you don't simply rename "Blog" to "Work" in your website ?

4 Answers

Eric Huang
Eric Huang
5,318 Points

Fixed this by using Breadcrumb NavXT plugin. This will let you be able to specify root page for your custom post type.

Eric Huang
Eric Huang
5,318 Points

Like I said above, if I changed blog to work, it just affects the naming but still get directed to blog page. I want it to become "work" page. Anything I can do with this?

Zachary Dahan
Zachary Dahan
2,392 Points

Awh then, sorry I didn't really understood. But If what I've understood is good, you want to use another template file especially for the single-work.php ? Then add this to the top of single-work.php :

<?php
/*
Template Name: Work Article
*/

If I'm totally out, then I'm sorry for losing your time. :c

Eric Huang
Eric Huang
5,318 Points

I did that to call the template on my "work" page and create single-work.php file but for some reason the plugin doesn't recognize single-work.php as the child of work.php? Am I explaining correctly?

Anyway, thanks man for taking time to answer my question. Is there anyone can help me with this?