WordPress.org

Support

Support » How-To and Troubleshooting » Using post_tag taxonomy when creating a Custom Post Type

Using post_tag taxonomy when creating a Custom Post Type

Viewing 5 replies - 1 through 5 (of 5 total)
  • chrisbrocklesby
    Member

    @chrisbrocklesby

    Same Question here… Any Ideas ?

    chrisbrocklesby
    Member

    @chrisbrocklesby

    Bingo !

    add_action(‘init’, ‘add_taxonomy_objects’);

    function add_taxonomy_objects() {
    register_taxonomy_for_object_type(‘category’, ‘product’);
    register_taxonomy_for_object_type(‘post_tag’, ‘product’);
    }

    StevieG
    Participant

    @stevieg

    @chrisbrocklesby I’m having the same problem. Your solution just adds the meta-box to the custom post. i think what Albert (and certainly I) mean is that once a tag is assigned to the new custom post it doesn’t show up under the mormal tag archive.

    Were you ever able to fix this? I have the same issue. Tagging works, but custom types don’t show on the archive.

    I had this problem as well. The solution for me was to use get_the_terms() rather than get_the_tags(). In get_the_terms you can specify which taxonomy to get — get_the_tags only checks for post_tag.

    http://codex.wordpress.org/Function_Reference/get_the_terms

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using post_tag taxonomy when creating a Custom Post Type’ is closed to new replies.