Taxonomy Drill-Down / Plugin Help – hierarchical queries within plugin?

I had done some work for my upcoming theme which shows category tree (Taxonomy drill down) from custom taxonomy. You can show it on taxonomy page or on category page. if(! defined(‘TH_TAX_TYPE’)) define(‘TH_TAX_TYPE’,’your-tax-type’); function is_decendent($term_id,$main_parent) { $terms= get_term_by(‘id’, $term_id,TH_TAX_TYPE); $parent_term= get_term_by(‘id’, $terms->parent,TH_TAX_TYPE); $grand_parent_term= get_term_by(‘id’,$parent_term->parent,TH_TAX_TYPE); if($terms || $grand_parent_term){ if($grand_parent_term->term_id==$main_parent){ return TRUE; } } return FALSE; } … Read more

Add tags to custom post type without menu link

To remove the submenu Tags link from the admin menu, you might try add_action( ‘admin_menu’, ‘custom_admin_menu’ ); function custom_admin_menu() { // debug to find the correct submenu slug: // global $submenu; // print_r($submenu); $menu_slug = ‘edit.php?post_type=infographics’; $submenu_slug = ‘edit-tags.php?taxonomy=post_tag&post_type=infographics’; remove_submenu_page( $menu_slug, $submenu_slug ); } if your custom post type is infograhpics. By viewing the global … Read more

Get posts from multiple tax terms

I honestly don’t see how that works at all since get_the_term_list returns an HTML string. First, you need get_the_terms and wp_list_pluck. Second, you need a tax_query. That {tax} = {term} pattern is deprecated. $this_post = $post->ID; $args = array( ‘post_type’ => ‘dir_entry’, ‘posts_per_page’ => 10, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘post__not_in’ => array($this_post), ); … Read more

Hide image if taxonomy term is empty

Instead of write manually the html code for your flags, you should create it using php and wordpress functions: $countries = get_terms(‘country’, array(‘hide_empty’ => true) ); $exclude_terms = array(‘featured’); if ( ! empty($countries) && is_array($countries) ) { ?> <img class=”mapAdjust” src=”https://wordpress.stackexchange.com/questions/114245/<?php bloginfo(“template_url’); ?>/img/map-adjust.gif” /> <img class=”map” src=”https://wordpress.stackexchange.com/questions/114245/<?php bloginfo(“template_url’); ?>/img/map.jpg” /> <?php foreach ( $countries as … Read more

get_category_link() for custom post type does not include custom slug rewrite?

Your category URLs are correct, they won’t change by virtue of being associated with a custom post type. I’ll guess that the problem is that default category queries do not include any custom post types, so will display “Nothing found” on term pages where the only associated posts are a CPT. To fix that, you … Read more

is_taxonomy() is not working

use is_tax() instead of is_taxonomy() as is_taxonomy() depreciated since v3.0 Refer to http://codex.wordpress.org/Function_Reference/is_tax for usage reference