• Resolved myironlung3

    (@myironlung3)


    I have created a custom post type called “Products” (slug=”products”) and a custom taxonomy called “Product Categories” (slug=”product-categories”).

    I want to include the product category in the URL for the single product pages. For example, it should like this:

    http://domain.com/products/shoes/nike-air-jordan

    I am exporting the code to my functions file and I see the rewrite argument where the product category should be added (see below). However, I don’t know how to query the product category here or if it is possible to do that within this argument.

    'rewrite' => array('slug' => 'products', 'with_front' => true),

    I’m thinking…

    'rewrite' => array('slug' => $productcategory, 'with_front' => true),

    $productcategory = ? (This is the part I can’t figure out.)

    http://wordpress.org/plugins/custom-post-type-ui/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Admittedly, I’m not all that sure either. I’m not very well versed with the rewrite api portion of things. Hopefully you’ve found an answer since then though, and I wish I was a better help.

Viewing 1 replies (of 1 total)

The topic ‘Custom Post Type Rewrite’ is closed to new replies.