0

Read a couple of tutorials (here's one) but I don't understand why I can't make it work. I'm trying to create a page for custom taxonomy terms. Like mysite.com/tag/term or mysite.com/category/term but for my taxonomy.

This is what I've done so far:

  1. I registered the new taxonomy

    add_action( 'init', 'register_taxonomy_author' );
    
    function register_taxonomy_author() {
         register_taxonomy(  'author', 'post',   //Let WordPress know that the artist   taxonomy has posts
    array(
        'hierarchical' => false,
        'label' => 'Authors', // This tells WordPress how to label the various user interface outlets for the artist taxonomy
        'query_var' => true,
        'rewrite' => array( 'slug' => 'author', 'with_front' => false ))
        );
    }
    
  2. Added a new file called taxonomy-author.php and copied+pasted the codes from category.php into it.


Now, when I try to view the taxonomy terms (Admin Panel > Posts > Authors > View) I get directed to mysite.com/author/term, which is great. But that page uses index.php instead of taxonomy-author.php. What did I miss? Codex states that index.php should be at the bottom, yet it ignores both taxonomy-author.php and my archive.php.

0

Sorry I forgot you can do this. Anyway the problem was that author was a reserved name. I have no idea why it worked for s_ha_dum though, but changing the name would be the safest option.

  • "I forgot you can do this" - It's not that you can do this, but rather that you should do this. Stack Exchange sites are not support forums, but rather Question-and-Answer sites. – Chip Bennett Jan 11 '14 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.