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

Primary Taxonomy for Post

This post is super old but I’ll post my solution here in case anyone else stumbles across this. If you’re using Yoast SEO you can hook into their existing implementation (they do this already for categories). function add_variety_primary_term_taxonomy( $taxonomies, $post_type, $all ) { if( $post_type == ‘product’ && isset( $all[‘my_custom_tax’] ) ) { $taxonomies[‘my_custom_tax’] = … Read more

Custom taxonomy archive templates not found

The page not found error doesn’t mean that the template file is not found/used. Note that a URL returns a 404 status header (not found), then 404.php is used (or index.php if 404.php doesn’t exist). I think your real problem is that you have not flushed the rewrite rules after the taxonomy has been registered. … Read more

$term->taxonomy stripping out underscores

WordPress sees underscore names as relating to post types and dashes as relating to taxonomies. Perhaps this has something to do with it? Also, have you flushed your permalinks recently (change the permalink structure to something else and then back)? It might be stuck in your database with the “sanitized” taxonomy name. This has happened … Read more