Custom Post Type Categories Not Displaying On Archive Page
-
I created a FAQ custom post type; however, when you click the FAQ category link at the base of an FAQ post, the archive shows no results.
Here is the code used for the CPT. Thanks for taking a look.function custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'FAQs', 'Post Type General Name', 'twentythirteen' ), 'singular_name' => _x( 'FAQ', 'Post Type Singular Name', 'twentythirteen' ), 'menu_name' => __( 'FAQs', 'twentythirteen' ), 'parent_item_colon' => __( 'Parent FAQ', 'twentythirteen' ), 'all_items' => __( 'All FAQs', 'twentythirteen' ), 'view_item' => __( 'View FAQ', 'twentythirteen' ), 'add_new_item' => __( 'Add New FAQ', 'twentythirteen' ), 'add_new' => __( 'Add New', 'twentythirteen' ), 'edit_item' => __( 'Edit FAQ', 'twentythirteen' ), 'update_item' => __( 'Update FAQ', 'twentythirteen' ), 'search_items' => __( 'Search FAQ', 'twentythirteen' ), 'not_found' => __( 'Not Found', 'twentythirteen' ), 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'faqs', 'twentythirteen' ), 'description' => __( 'Frequently asked questions', 'twentythirteen' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', 'show_in_rest' => true, // This is where we add taxonomies to our CPT 'taxonomies' => array( 'category' ), ); // Registering your Custom Post Type register_post_type( 'faqs', $args ); } /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ add_action( 'init', 'custom_post_type', 0 );
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom Post Type Categories Not Displaying On Archive Page’ is closed to new replies.