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

Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months

First of all I don’t think you should use your custom query_posts in here. WordPress already queries posts on archive pages, so it’s waste of time to query them one more time. You should be using pre_get_posts filter. function my_pre_get_posts($query) { if (!is_admin() && is_main_query() ‘<YOUR_POST_TYPE>’ === $query->query_vars(‘post_type’) && $query->is_archive()) { $query->set(‘orderby’,’meta_value’); $query->set(‘meta_key’, ‘<YOUR_POST_TYPE>’); //formatted … Read more

Exclude taxonomy term from all loops, but having it on widget

Looks like you’ve excluded a taxonomy term, not the whole taxonomy. Is that what you intended? But on to the answer… Right before your query in the widget add: remove_action( ‘pre_get_posts’, ‘exclude_category_posts’ ); And then you probably want to put it back again after that query by repeating: add_action( ‘pre_get_posts’, ‘exclude_category_posts’ ); That is a … Read more