Custom categories and custom tags in custom post type

  • Author
    Posts
  • #1268159

    karobrand
    Member

    Seeking help from all WordPress gurus.
    ‘m stuck on following error.

    How to display and filter custom categories and custom tags in custom post type?
    I have registered custom post type: register_post_type('portfolio', array(
    'label' => 'Projects',
    'description' => '',
    'public' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'rewrite' => array('slug' => 'portfolio'),
    'query_var' => true,
    'has_archive' => true,
    'exclude_from_search' => false,
    'supports' => array('title','editor','excerpt','custom-fields','comments','revisions','thumbnail','author','page-attributes',),
    'labels' => array (
    'name' => 'Projects',
    'singular_name' => 'Project',
    'menu_name' => 'Projects',
    'add_new' => 'Add Project',
    'add_new_item' => 'Add New Project',
    'edit' => 'Edit',
    'edit_item' => 'Edit Project',
    'new_item' => 'New Project',
    'view' => 'View Project',
    'view_item' => 'View Project',
    'search_items' => 'Search Projects',
    'not_found' => 'No Projects Found',
    'not_found_in_trash' => 'No Projects Found in Trash',
    'parent' => 'Parent Project',
    ),
    )
    );

    I have registered custom taxonomies ‘cat’ and ‘tags’ (different from blog taxonomies):
    register_taxonomy(
    'cat',
    array (0 => 'portfolio',),
    array(
    'hierarchical' => true,
    'label' => 'Categories',
    'show_ui' => true,
    'query_var' => true,
    'rewrite' => array('slug' => 'cat'),
    'singular_label' => 'Category'
    )
    );
    register_taxonomy(
    'tags',
    array (0 => 'portfolio',),
    array(
    'hierarchical' => false,
    'label' => 'Tags',
    'show_ui' => true,
    'query_var' => true,
    'rewrite' => array('slug' => 'tags'),
    'singular_label' => 'Tag'
    )
    );

    I have page with template file portfolio.php in theme`s page-templates folder.
    I tryed to make custom template pages like: cat.php, portfolio-cat.php, archive-cat.php, archive-portfolio.php, but newer wordpress founds this template, just shows 404 page.
    If i display the_terms( $post->ID, ‘cat’ , ‘ ‘ );, it shows right categories, but linking to blog (domain.com/blog/cat/residental [residental = category]).
    My site uses Multilingual Press Plugin with Network Sites for it.

    I’ll appreciate any help
    Thanks.

    #1268255

    1tess
    Moderator Emeritus

    You are in the wrong forum. These forums are for wordpress.com and we cannot help you here: you need to head over to wordpress.org.
    http://wordpress.org/support/

    #1268257

    karobrand
    Member

    Thanks

    sorry for wrong section

The topic ‘Custom categories and custom tags in custom post type’ is closed to new replies.