I have created two custom post types (CPT) say books and reviews. Now how can i auto generated a reviews page for a specific book title??.
What i have done so far i made a review page (page-reviews.php) which displays the reviews based on a book's $id. In CPT "reviews" there is a dropdown menu with id's corresponding the book title.
I thought of something like mydomain.com/books/{title-book}/reviews
But how can i auto generate this url path to be recognized and how do i get the book's $id in reviews (page-reviews.php)
should i alter the
'hierarchical' => true,
'rewrite' => array( 'slug' => 'reviews' ),
Regards,
'rewrite' => array( 'slug' => 'books/%postname%/reviews' ),
which looks like what i want but i get a 404 – alex Sep 12 '14 at 16:51register_post_type
call, that URL is for the location of the archive and review posts, not an archive of all review posts with a parent or link to another post of another type also in the URL. You will need custom rewrite rules and archives. – Tom J Nowell♦ Sep 12 '14 at 18:03