hi,
I’ve created 2 custom posts.And I’m trying to make the urls right.
One custom post type has just products with some ACF fields.
The other post type has the lists of products. With a ACF relational picker from the other custom post type “products”. The user picks witch products are shown.
No problems getting data out to the screen correctly.
But the URL should be like this:
This page contaings the list of all productlists with links to a single list. Works fine.
example.com/productlist/
This page contains the list of all products picked in that productlist, with links to the single products. Works fine.
example.com/productlist/title-of-list/
And finally when clicking in one link in the “title-of-list” above, it should result in this:
example.com/productlist/some-title-of-list/the-name-of-the-product
But so far I’ve managed to get this link:
example.com/product/the-name-of-the-product
or similar for example this also missing the “productlisttitle”, so the breadcrumbs is not right.
example.com/productlist/product/the-name-of-the-product
Functions.php
productspage:
This is achieved by using “has archive”
‘has_archive’ => ‘productlist’,
‘rewrite’ => array(‘slug’=>’productlist/product’, ‘with_front’=> false),
this should be somehow wich a rewrite_tag or something:
‘rewrite’ => array(‘slug’=>’productlist/productlisttitle/product’, ‘with_front’=> false),
productslistpage:
‘rewrite’ => array(‘slug’=>’productlist’,’with_front’=> false),
No how do I fix this urls structure?
I’ve tried alot of things 🙂