WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom taxonomy redirects to content page (1 post)

  1. sccr410
    Member
    Posted 3 years ago #

    I am using custom taxonomies for my portfolio. Whenever you click on the URL for the custom taxonomy, it redirects to a Page I have setup with the same name. If I click on a taxonomy that does not have a page, it gives me a 404 error.

    register_post_type('portfolio', array('label' => 'Projects','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => true,'rewrite' => true,'query_var' => true,'has_archive' => true,'supports' => array('title','editor','custom-fields','thumbnail',),'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',
    ),) );
    
    register_taxonomy('portfolio-services',array('portfolio'),array( 'hierarchical' => true, 'label' => 'Services','show_ui' => true,'query_var' => true,'rewrite' => array('slug' => 'portfolio-type'),'singular_label' => 'Service') );

    Resolved issue - just need to resave permalinks in admin after you make changes.

Topic Closed

This topic has been closed to new replies.

About this Topic