Support » Fixing WordPress » Custom taxonomy redirects to content page

  • Resolved sccr410

    (@sccr410)


    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.

  • The topic ‘Custom taxonomy redirects to content page’ is closed to new replies.