WordPress custom taxonomy page

You have a few issues –

  1. You’re setting query_var to 'book' in your custom taxonomy, which is clashing with the query var for your custom post type. change that to true and it will default to the name of the taxonomy, 'rating'.

  2. There is no has_archive argument for register_taxonomy, though this is probably not effecting anything. This makes sense if you think about it, since a taxonomy term is always a form of archive.

  3. The last issue you may encounter is one of precedence – if multiple rewrite rules apply to a given URL, the one with highest precedence will be chosen. If you register your post type first, then your taxonomy, using your example http://localhost/wordpress/book/rating/nice, WordPress will think you want to load an attachment named nice belonging to a book named rating. If you register your taxonomy first, then register your post type, your taxonomy will take precedence in this case and everything should work as expected.

tech