Different single page templates for taxonomies

Use the single_template filter in your functions file with the correct conditional tag add_filter( ‘single_template’, ‘single_tax_term_template’ ); function single_tax_term_template( $single_template ) { global $post; if ( has_term( ”, ‘article’ ) ) { $single_template = dirname( __FILE__ ) . ‘/article.php’; } if ( has_term( ”, ‘news’ ) ) { $single_template = dirname( __FILE__ ) . ‘/news.php’; … Read more

Set Custom Taxonomy to Entire Site Programatically

I got it to work by registering a custom taxonomy… add_action( ‘init’, ‘create_country_tax’ ); function create_country_tax() { $userInfo = geoip_detect2_get_info_from_current_ip(); $country = $userInfo->country->isoCode; register_taxonomy($country,’country’); } and then calling taxonomy_exists(‘US’).

Failure to add term meta

This turned out to be a database issue. Due to some security measures put in place by the infrastructure team, the network upgrade script was prevented from completing the upgrade on all sites. Thus, for the specific site within our WordPress Network on which this plugin was being tested, the wp_termmeta table had not been … Read more

Problems with taxonomy quick edit box

If you have multiple <a href=”#” class=”editinline”>#</a> your jQuery should use on() to save memory. Add .editinline selector to attach the function (handler) to multiple elements (in this case — <body> children) jQuery(‘body’).on(‘click’, ‘.editinline’, function(){ var now = jQuery(this).closest(‘tr’).find(‘td.column-special_star’).text(); //console.log(now); if (now.charAt(0)==’S’) {now_i = ‘1’;}; if (now.charAt(0)==’N’) {now_i = ‘0’;};look like this //console.log(now_i); jQuery(‘#special_star_val’).val( now_i … Read more