How to Get Current Custom Post Type Associated Taxonomy Term

// First, get associated taxonomies of the post/object. $object_taxonomies = get_object_taxonomies( get_post() ); // Next, get associated terms of the post/object. $object_terms = wp_get_object_terms( get_the_ID(), $object_taxonomies ); $terms = array(); // returned object terms could be WP_Error, so check that first. if( ! is_wp_error($object_terms) && is_array($object_terms) ) { foreach( $object_terms as $object_term ) { // … Read more

Custom post type, permalinks, taxonomies and blog posts

I would do as @cfx suggested: register_taxonomy( // Call before register_post_type() to give rewrite rule priority. ‘bike_category’, // Should be singular, not bikes_category ‘bike’, array( ‘rewrite’ => array( ‘with_front’ => false, // This will strip the “blog” prefix ‘slug’ => ‘bikes’, ), // Other args ) ); register_post_type( ‘bike’, // Post type should be singular … Read more