0

I have a custom taxonomy, called "location", everything works fine, I can use it for labeling "open job position", but the problem occurs, when I try to access the archive or click on a taxonomy tag.

I have:

Here is the code:

if ( ! function_exists( 'custom_taxonomy_career' ) ) {

    // Register Custom Taxonomy
    function custom_taxonomy_career() {

        $labels = array(
            'name'                       => _x( 'Locations', 'Taxonomy General Name', 'foxconndrc' ),
            'singular_name'              => _x( 'Location', 'Taxonomy Singular Name', 'foxconndrc' ),
            'menu_name'                  => __( 'Locations', 'foxconndrc' ),
            'all_items'                  => __( 'All Items', 'foxconndrc' ),
            'parent_item'                => __( 'Parent Item', 'foxconndrc' ),
            'parent_item_colon'          => __( 'Parent Item:', 'foxconndrc' ),
            'new_item_name'              => __( 'New Item Name', 'foxconndrc' ),
            'add_new_item'               => __( 'Add New Item', 'foxconndrc' ),
            'edit_item'                  => __( 'Edit Item', 'foxconndrc' ),
            'update_item'                => __( 'Update Item', 'foxconndrc' ),
            'view_item'                  => __( 'View Item', 'foxconndrc' ),
            'separate_items_with_commas' => __( 'Separate items with commas', 'foxconndrc' ),
            'add_or_remove_items'        => __( 'Add or remove items', 'foxconndrc' ),
            'choose_from_most_used'      => __( 'Choose from the most used', 'foxconndrc' ),
            'popular_items'              => __( 'Popular Items', 'foxconndrc' ),
            'search_items'               => __( 'Search Items', 'foxconndrc' ),
            'not_found'                  => __( 'Not Found', 'foxconndrc' ),
            'no_terms'                   => __( 'No items', 'foxconndrc' ),
            'items_list'                 => __( 'Items list', 'foxconndrc' ),
            'items_list_navigation'      => __( 'Items list navigation', 'foxconndrc' ),
        );
        $args = array(
            'hierarchical'      => true,
            'labels'            => $labels,
            'show_ui'           => true,
            'show_admin_column' => true,
            'query_var'         => true,
            'public'            => true,
            'exclude_from_search' => false,         
            'rewrite'           => array( 'slug' => 'career_location' ),
        );
        register_taxonomy( 'career_location', array( 'career', 'post' ), $args );

    }
    add_action( 'init', 'custom_taxonomy_career', 0 );

}

Here is whole CPT with the code: https://pastebin.com/LqEkv0ZW

2
  • Are all $labels are essential in your question? And will somebody go to the third-party site to view your code? I see the general code you've published with no alterations. It's a standard. Rethink and edit.
    – Max Yudin
    Commented Aug 5, 2017 at 23:05
  • @MaxYudin yes, it's general code, but somehow it seems that I can access archive from custom post type (even if there are no modifications), the issue is easy to replicate and even if I have asked colleagues we haven't found an answer. Commented Aug 6, 2017 at 11:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.