Help with hierarchical custom taxonomies and permalinks…almost there

Ok, I managed to get it working by hooking into the ‘request’ filter, then checking to see if the last segment is term or not. If it’s not, change the $request var: function alter_the_query( $request ) { $dummy_query = new WP_Query(); // the query isn’t run if we don’t pass any query vars $dummy_query->parse_query( $request … Read more

Manipulating cookie on specific taxonomy archive page

After googling around I found the correct way to do it by using the ‘wp’ hook if (is_tax(‘term-country’)) add_action(‘wp’, ‘my_setcookie’); // my_setcookie() set the cookie on the domain and directory WP is installed on function my_setcookie(){ $path = parse_url(get_option(‘siteurl’), PHP_URL_PATH); $host = parse_url(get_option(‘siteurl’), PHP_URL_HOST); $expiry = strtotime(‘+1 month’); setcookie(‘location’, ‘my_cookie_value_3’, $expiry, $path, $host); }

custom post type archive template per custom taxonomy term

I solved it. SOLUTION: <?php if ( has_term( ‘downloads’, ‘listen’, $post->ID ) ) { get_template_part( ‘templates/content-downloads-vergriffener-baende’ ); } elseif ( has_term( ‘untersuchungen’, ‘listen’, $post->ID ) ) { get_template_part( ‘templates/content-untersuchungen’ ); } elseif ( has_term( ‘studien-materialien’, ‘listen’, $post->ID ) ) { get_template_part( ‘templates/content-studien-materialien’ ); } elseif ( has_term( ‘sonderbaende-kataloge’, ‘listen’, $post->ID ) ) { get_template_part( ‘templates/content-sonderbaende-kataloge’ … Read more

Custom Taxonomies Incorrectly Counting Revisions?

Hi @berkleebassist: It’s hard to verify your issue without admin access to your site and your database but I can give you some direction that might help. There are two functions in /wp-includes/taxonomy.php that update taxonomy term count: wp_update_term_count_now() and _update_post_term_count(). They are located (in WordPress v3.0.1) at line 2454 and line 2049, respectively. Both … Read more

Taxonomies not appearing in columns on dashboard

Call register_taxonomy() with ‘show_admin_column’ => TRUE and WordPress will create your columns automatically. This parameter was added in version 3.5. You don’t need a custom filter anymore. I have written a small plugin to demonstrate this case: t5-taxonomy-location. This is the registration code: protected function register_taxonomy() { $this->set_labels(); $args = array ( ‘labels’ => $this->labels, … Read more

Is there a way of storing posts and pages under the same hierarchy?

Yes, a custom taxonomy is the best way to achieve this. For a cat breeder site I’ve set a taxonomy for colors (in german: Farbe): register_taxonomy( ‘farbe’, array( ‘post’, ‘page’ ), array( ‘hierarchical’ => false, ‘label’ => ‘Farbe (Fell)’, ‘query_var’ => ‘farbe’, ‘rewrite’ => array(‘slug’ => ‘farbe’) ) ); Note the third parameter array( ‘post’, … Read more

Approach for saving a product attribute values with a custom UI in a woocommerce+dokan set up [closed]

Actually, this ended up being straight forward. Displaying the drop down I used this line to get the list of terms for my pa_condition taxonomy: $attr_condition = get_terms( array( ‘taxonomy’ => ‘pa_condition’, //empty string(”), false, 0 don’t work, and return empty array ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => false, //can be 1, ‘1’ … Read more