Show Taxonomies with admin area for custom post type?

As documented, you can set the show_admin_column argument of register_taxonomy() to true to do this: ‘show_admin_column’ (bool) Whether to display a column for the taxonomy on its post type listing screens. Default false. For example: register_taxonomy( ‘subject’, // The name of the taxonomy. Name should be in slug form (must not contain capital letters or … Read more

Only show posts with a specific term of an associated taxonomy in a custom post type archive

Try adding to functions.php function filter_movies( $query ) { if( !is_admin() && $query->is_main_query() && $query->get(‘post_type’) == ‘movie’) { $tax_query = array( array( ‘taxonomy’ => ‘period’, ‘field’ => ‘slug’, ‘terms’ => ‘current’, ), ); $query->set( ‘tax_query’, $tax_query ); } } add_action(‘pre_get_posts’, ‘filter_movies’, 9999);

Change custom taxonomy archive permalink

You can use the rewrite parameter to customize the taxonomy permalinks. Here’s an example which links the taxonomy to the default post post type: register_taxonomy( ‘video_category’, ‘post’, [ ‘public’ => true, ‘rewrite’ => [ ‘slug’ => ‘videos/category’, ], // … your other parameters .. ] ); Don’t forget to flush the rewrite rules — just … Read more

WP_Query to output chosen term and posts with no term assigned

It’s actually pretty simple: You’ll want to use an OR relation, and use the NOT EXISTS operator for selecting posts that are not assigned to any terms in the specified taxonomy. $tax_query[] = array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘location’, ‘field’ => ‘name’, ‘terms’ => $location, ), array( ‘taxonomy’ => ‘location’, ‘operator’ => ‘NOT … Read more