WordPress.org

Ready to get started?Download WordPress

Forums

Custom Taxonomies For Pages? (3 posts)

  1. musicmasteria
    Member
    Posted 4 years ago #

    add_action( 'init', 'create_my_taxonomies', 0 );
    
    function create_my_taxonomies() {
    	register_taxonomy( 'genres', 'page', array( 'hierarchical' => false, 'rewrite' => array('slug'=>'genre'), 'query_var' => 'genre' ) );
    	register_taxonomy( 'themes', 'page', array( 'hierarchical' => false, 'rewrite' => array('slug'=>'theme'), 'query_var' => 'theme' ) );
    }

    What's wrong with that code?
    If I change 'page' to 'post' then it works and shows up on the Add New Post page but that's not what I want to use it for. I need them for pages and I thought custom taxonomies were supposed to work with pages.

    I'd like category-like boxes for Genres and Themes, but I guess I could settle on tag-like boxes if I had to.

    Anyone know what's up?

  2. carlla
    Member
    Posted 4 years ago #

    Maybe you'd like to take a look in that topic: http://wordpress.org/support/topic/297562

    I am facing the same problem =/

  3. Mark / t31os
    Moderator
    Posted 4 years ago #

    If it makes you feel any better i have the same problem when trying to create taxonomies for pages a little while back.

    Unfortunately i've not had a real need for page taxonomies, so i've not looked at why for more then a few minutes..

    Might be worth checking Trac to see if there's any outstanding bugs for the issue.

Topic Closed

This topic has been closed to new replies.

About this Topic