• Hello everybody

    I’m implementing a testing project and from 2 days I’m fighting with the permalink. I want to share with you my problem:

    I created a custom post type products;
    I created a custom taxonomy brand associated to products;
    into taxonomy I created 2 categories: nike and adidas;
    I finally created a product t-shirt and I categorized it as nike.

    What I would obtain is a permalink like this:

    www.example.com/products/nike/t-shirt

    Instead this it happens:

    I can visit the page of category nike
    /products/nike/
    where there are links to t-shirt posts.

    On the t-shirt page the permalink changes and becomes
    /products/t-shirt/

    In practice, I lose the reference to category /nike/

    what I get: /products/t-shirt/
    what I would like: /products/nike/t-shirt/

    I fix this with a static solution:

    into the custom post type I added
    'rewrite' => array('slug' => 'products/nike','with_front' => false),

    can I replace nike with something filter?

    Any idea?

Viewing 5 replies - 16 through 20 (of 20 total)
  • Hi guys!

    Great works, but i’m looking for something a little more…advanced 😀

    I would like to have the parent taxonomy (categorie of portfolio in my case) into the URL.

    Actually, with your help, i got :

    /portfolio/hobby/project-11/ which is already a nice trick 🙂

    I woull like to have something like this, i check the “hobby” category for my project :
    /portfolio/hobby-parent1/hobby-parent2/hobby/project-11/

    Someone ? 🙂

    Thanks !

    Robert3d,
    your solution works perfectly! so thank you!
    I wish I could Up Vote!

    Thread Starter lopinsjk

    (@lopinsjk)

    Good work guys 😉

    Cortez77

    (@cortez77)

    I’m having the same issue as Robert3D trying to make the next / last links (pagination) work on the custom-taxonomy page using this set-up.

    I started another thread here as suggested by Barrel rider but not getting any love and thought I’d give a shout out here as it directly relates to this thread.

    Any suggestions at all are appreciated.
    Cheers

    Very nice tuto!
    I have very few knowledge for both PHP and WordPress,
    so this tuto helped me a lot.
    I was banging my head against the wall, lol.
    I must say thank you firstly.

    Following lopinsjk’s instruction, i could successfully displayed Custom Post Type(CPT) page with desired URL 🙂
    ex.)

    So far so good, but here I need a further instruction for sub categories.

    I have some child categories (or maybe grand child categories in future…) under the parent categories and those have some pages.

    URL looks like this for pages under the sub categories:
    http://sample.com/CPT/category/page_name/

    So I want URL to look like:
    http://sample.com/CPT/category/child-category-slug-name/page_name/
    or
    http://sample.com/CPT/category/child-category-slug-name/grand-child-category-slug-name/page_name/

    Need a little tweak for URL,
    but I have no clue how I can achieve it.

    Anyone has idea?

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Insert category of taxonomy between custom post type and post’ is closed to new replies.