Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working on portfolio site, where I need to create a "portfolio" post type and divide posts in it by categories with urls like "/portfolio/category/", so the "category" is the category term.

/portfolio/ - custom post type "portfolio"

/portfolio/category/ - custom taxonomy "portfolio_category", related to "portfolio" type.

/portfolio/post/ - post of the "portfolio" custom post type.

What is the best way to make this url structure?

share|improve this question
add comment

1 Answer

I hope i understand you :)

I think the easiet way (in my humble opion) the best way is to use taxomonies like so:

function portfolio_taxomony() {
register_taxonomy( 'portfolio', 'post', array( 'hierarchical' => true, 'label' => 'Web Design', 'query_var' => true, 'rewrite' => true ) );  
}

add_action( 'init', 'portfolio_taxomony', 0 );  

(Web Design if of course an example)

That way you'll have a url like this: http://www.site.com/portfolio/web-design/postname/

To me that looks great from an seo point of view because the url is like a "story" and also, easy to do..

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.