WordPress Custom Taxonomy Template file

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.

Read More

Thanks

Related posts

Leave a Reply

1 comment

  1. See WordPress’ template hierarchy documentation.

    You must create a file called taxonomy-ebookgenre.php in your theme directory (or have one of taxonomy.php, archive.php, or index.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.