Use the custom post type archive for taxonomies?

You can create taxonomy-cat-cpt.php, and inside it just use: <?php get_template_part( ‘archive-cpt’ ); ?> Then they’ll both use the same template. Then inside archive-cpt.php, if you use the_archive_title() archive the_archive_description() it will display the appropriate title and description automatically based on whether you’re viewing the taxonomy or post type archive. Regarding posts, as long as … Read more

Twin value tags as an esoteric taxonomy

When importing you could create a taxonomy for each unique stance key, then add the value as a term to the taxonomy for that key, then assign that term to the post. I’d suggest something like: Store the stance keys somewhere in the database (probably as options), making sure that you don’t have duplicates. Depending … Read more

Add term slug in URL of custom post type details page

You need to update below line at where you have register a custom post type using register_post_type function. ‘rewrite’ => array(‘slug’ => ‘movies/%cat%’) To change permalink dynamically of post type you have to add below code in functions.php file : function change_link( $post_link, $id = 0 ) { $post = get_post( $id ); if( $post->post_type … Read more

custom page for custom Taxonomy

The correct template to use in this case would be taxonomy-veranstaltungen-category.php, and that template needs to use the main loop. So, at a bare minimum you should have taxonomy-veranstaltungen-category.php with the following code: <?php get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php the_title(); ?> <?php endwhile; ?> <?php get_footer(); ?> That will … Read more

Display a post from custom post type only if all the selected taxonomies and custom field value matches the record

You have set “roll_number” custom field in tax_query. It should be in “meta_query”. Please try the updated code: tion exam_result_filter_function(){ $args = array( ‘post_type’ => ‘exam_result’, ); if( isset( $_POST[‘school_class’] ) || !empty( $_POST[‘academic_year’]) || !empty( $_POST[‘roll_number’]) ){ $args[‘tax_query’] = array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘school_class’, ‘field’ => ‘id’, ‘terms’ => $_POST[‘school_class’], ), … Read more

CPT Taxonomy As Archive Page – Error 404

You use the same slug clubs to register your custom post type and in rewrite when you register opposition taxonomy. Change rewrite parameter in register_taxonomy() ‘rewrite’ => array( ‘slug’ => ‘clubs/opposition’, ‘with_front’ => false ), The recognizable address will be clubs/opposition/{some-term-name} and will display posts from custom category. However, the clubs/opposition address will still not … Read more