Custom post type with new taxonomy [duplicate]

$labels = array( ‘name’ => _x( ‘Categories’, ‘taxonomy general name’ ), ‘singular_name’ => _x( ‘Category’, ‘taxonomy singular name’ ), ‘search_items’ => __( ‘Search Types’,’SkyDance’ ), ‘all_items’ => __( ‘All Category’,’SkyDance’ ), ‘parent_item’ => __( ‘Parent Category’,’SkyDance’ ), ‘parent_item_colon’ => __( ‘Parent Category:’,’SkyDance’ ), ‘edit_item’ => __( ‘Edit Categories’,’SkyDance’ ), ‘update_item’ => __( ‘Update Category’,’SkyDance’ ), … Read more

Get custom taxonomy value of post and output posts in same taxonomy

try with this function function get_posts_in_taxonomy($post_type, $taxonomy, $term_id, $include_children=false, $limit) { $args = [ ‘post_type’ => $post_type, ‘posts_per_page’ => $limit, ‘tax_query’ => [ [ ‘taxonomy’ => $taxonomy, ‘terms’ => $term_id, ‘include_children’ => $include_children ], ], // Rest of your arguments ]; $posts = new WP_Query( $args ); if($posts->have_posts()) { while($posts->have_posts()) { $posts->the_post(); //code todo here … Read more

Advanced WordPress search form based on custom taxonomy and custom meta value

I’ve recently developed a plugin that can support the custom taxonomy element of this problem. The plugin creates select boxes for each of your custom taxonomy terms and throws the results onto a custom results page (of your choosing): Advanced Custom Post Search It currently doesn’t support custom meta values if this is something you … Read more

Get custom taxonomy term url on archive page

If you are in term archive page, the taxonomy and term is actually set. You could hook wp_head to add the open graph in your functions.php: add_action( ‘wp_head’, ‘wpse_wp_head’ ); function wpse_wp_head () { //First, we check if we are in our custom taxonomy if( is_tax(‘my-custom-taxonomy’) ) { $taxonomy_slug = get_query_var( ‘taxonomy’ ); $term_slug = … Read more