Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #712690

    Hi

    I registered a custom taxonomy which worked well in my previous theme.
    After changing the theme to Enfold, custom taxonomy archive page results in 404 error.

    I declared the taxonomy as follows in the functions.php file:

    function add_custom_taxonomies() {
      // Add new "Area" taxonomy to Posts
      register_taxonomy('speciality', 'post', array(
        // Hierarchical taxonomy (like categories)
        'hierarchical' => true,
        // This array of options controls the labels displayed in the WordPress Admin UI
        'labels' => array(
          'name' => _x( 'Specialities', 'taxonomy general name' ),
          'singular_name' => _x( 'Speciality', 'taxonomy singular name' ),
          'search_items' =>  __( 'Search Specialities' ),
          'all_items' => __( 'All Specialities' ),
          'parent_item' => __( 'Parent Speciality' ),
          'parent_item_colon' => __( 'Parent Speciality:' ),
          'edit_item' => __( 'Edit Speciality' ),
          'update_item' => __( 'Update Speciality' ),
          'add_new_item' => __( 'Add New Speciality' ),
          'new_item_name' => __( 'New Speciality Name' ),
          'menu_name' => __( 'Specialities' ),
        ),
        // Control the slugs used for this taxonomy
        'rewrite' => array(
          'slug' => 'specificarea', // This controls the base slug that will display before each term
          'with_front' => false, // Don't display the category base before "/locations/"
          'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
        ),
      ));
    }
    add_action( 'init', 'add_custom_taxonomies', 0 );

    Is there a way to correct this issue?
    (One more question: Using custom taxonomy will affect the loading speed of the site? If then, I will just remove them.)

    • This topic was modified 8 years ago by elohimguy. Reason: Add one more question
    #712781

    Hey elohimguy,

    Did you try resetting your Permalink settings under Settings->Permalinks?

    Best regards,
    Rikard

    #712783

    Hi Rikard

    Really thanks for your help.
    I reset the Permalink settings and now it’s working.

    #712807

    Hi,

    Great, glad you got it working :-)

    Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

    #739354

    does one have to CHANGE or RESET the permalink settings?
    how does one RESET the permalink settings?
    Thanks
    : )
    Dara

    #739792

    Hi Dara,

    Inside WordPress Dashboard, you go to Settings > Permalinks, set it to default then save changes, then set it back to the ones you have before and save it again.

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.