I registered custom post type named e-books in wordpress and have also registered a taxonomy for that as well here goes the code
register_taxonomy('ebookgenre', 'ebooks',
array(
'label' => __( 'Categories' ),
'rewrite' => array( 'slug' => 'category' ),
'hierarchical' => true,
)
);
But when i am listing all taxonomy from ebookgenre and linking them it is going to 404. please tell me which file or temlate should i use.
Thanks
See WordPress’ template hierarchy documentation.
You must create a file called
taxonomy-ebookgenre.php
in your theme directory (or have one oftaxonomy.php
,archive.php
, orindex.php
files).Also, you should go to the WordPress Admin > Settings > Permalinks page. Simple visit the page, and WordPress will regenerate your rewrite rules. Your taxonomy will not work until you do this first. This is due to WordPress caching URL rewrite rules, so if you added your taxonomy after these were cached, the URLs won’t work. Whenever you visit the permalink settings page, the rewrite rules are flushed and re-cached.