I was able to solve this by removing CPT UI plugin, registering the custom post type with:
function create_post_type() {
$args = array (
'public' => true,
'has_archive' => true,
'show_ui' => true,
'supports' => array('revision','title','editor','author', 'thumbnail', 'custom-fields'),
'taxonomies' => array( 'category' ),
'labels' => array(
'name' => __( 'work' ),
'singular_name' => __( 'work' )
)
);
register_post_type('work', $args);
}
Then in category.php:
<?php get_header();
$args = array(
'post_type' => 'work',
'cat' => get_query_var('cat'),
'posts_per_page' => -1 );
$loop = new WP_Query( $args ); ?>
<!-- Slider main container -->
<div class="swiper mySwiper">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="swiper-slide"><?php the_content(); ?></div>
<?php endwhile; ?>
</div>
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<?php
// get_sidebar();
get_footer();
It wasn’t immediately intuitive that ‘cat’ needed to be specified to filter results by the current category, and not have all posts returned.
For now I’m using a plugin ‘Remove Taxonomy Slug’ to change the url from /category/name to /name
It seemed unnecessarily difficult to have the homepage be a specific category archive (from category.php) so I’m showing the About page instead.