WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.