wp_dropdown_categories in custom post type with custom taxonomy

get post id $post_id=get_the_ID(); get selected region $terms = wp_get_post_terms( $post_id, $taxonomy ); $selected_id=”; if(isset($terms[0]->term_id)){ $selected_id=$terms[0]->term_id; } build hierarchical dropdown wp_dropdown_categories( array( ‘show_option_all’ => ‘Choose a region’, ‘show_option_none’ => ”, ‘orderby’ => ‘ID’, ‘order’ => ‘ASC’, ‘show_count’ => 0, ‘hide_empty’ => 0, ‘child_of’ => 0, ‘exclude’ => ”, ‘echo’ => 1, ‘selected’ => $selected_id, ‘hierarchical’ … Read more

custom post type and custom taxonomy permalink

Something similar to this in your functions.php or a plugin will do the trick: function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘([^/]+)/cases/([^/]+).html’ => ‘index.php?genre=”. $wp_rewrite->preg_index(1) .”&case=”. $wp_rewrite->preg_index(2) ); $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; } // refresh/flush permalinks in the dashboard if this is changed in any way add_filter( “generate_rewrite_rules’, ‘custom_rewrite’ ); You will need … Read more

How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?

We can check out the /wp/v2/clock endpoint’s arguments here: https://myapp.dev/wp-json/wp/v2/ If we add the ‘show_in_rest’ => true, argument, when registering the custom clock_category taxonomy, it will add a support for this GET/POST argument: clock_category: { required: false, default: [ ], description: “Limit result set to all items that have the specified term assigned in the … Read more