ok this i didn’t know i had to “register” variable to use
function my_add_rewrite_rules() {
global $wp,$wp_rewrite;
$wp->add_query_var('book_id');
add_rewrite_rule('^books/([^/]*)/reviews/([0-9]+)/?$', 'index.php?page_id=227&bookid_id=$matches[2]', 'top');
// Once you get working, remove this next line
$wp_rewrite->flush_rules(false);
}
add_action('init', 'my_add_rewrite_rules');
and in page-reviews.php i am using
$book_id = $GLOBALS['wp']->query_vars['book_id'];
One last question: how do i fix my breadcrumbs as the books/…/reviews is not displayed in the breadcrumbs?