0

I have created a custom post type with the following arguments:

    $args = [
        'label'               => 'Projects',
        'labels'              => $labels,
        'description'         => 'Example projects undertaken',
        'public'              => true,
        'hierarchical'        => false,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'show_ui'             => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'show_in_rest'        => true,
        'query_var'           => true,
        'can_export'          => true,
        'delete_with_user'    => true,
        'has_archive'         => true,
        'rest_base'           => '',
        'show_in_menu'        => true,
        'menu_position'       => '',
        'menu_icon'           => 'dashicons-clipboard',
        'capability_type'     => 'post',
        'supports'            => ['title', 'editor', 'thumbnail', 'excerpt', 'custom-fields', 'page-attributes'],
        'taxonomies'          => ['category', 'post_tag'],
        'rewrite'             => [
            'with_front' => false,
        ],
    ];

I have created a custom taxonomy with the following arguments:

    $args = [
        'label'              => 'Services',
        'labels'             => $labels,
        'description'        => 'Services provided',
        'public'             => true,
        'publicly_queryable' => true,
        'hierarchical'       => true,
        'show_ui'            => true,
        'show_in_menu'       => true,
        'show_in_nav_menus'  => true,
        'show_in_rest'       => true,
        'show_tagcloud'      => true,
        'show_in_quick_edit' => true,
        'show_admin_column'  => true,
        'query_var'          => true,
        'sort'               => false,
        'meta_box_cb'        => 'post_categories_meta_box',
        'rest_base'          => '',
        'rewrite'            => [
            'with_front'   => true,
            'hierarchical' => false,
        ],
    ];

Individual pages show the taxonomies that they have, but when I follow the taxonomy archive page, it's empty.

2
  • Did you flush your permalinks?
    – vancoder
    Sep 8, 2022 at 18:07
  • Yeah, I tried that.
    – Badger
    Sep 14, 2022 at 11:02

1 Answer 1

0

I am clearly an idiot. I was using get_template_part( 'entry' ) and I had renamed the entry.php file…

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.