wp_get_object_terms count on taxonomies within an category archive

A simple function to count posts did the trick, but this is one more request in DB : function count_posts_in_cat_by_custom_term( $category_ID, $custom_taxonomy_name, $custom_term_id ){ $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘category’ => $category_ID, ‘tax_query’ => [ [ ‘taxonomy’ => $custom_taxonomy_name, ‘fields’=>’term_id’, ‘terms’ => $custom_term_id, ] ] ); $posts = … Read more

Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode

The following code is partialy taken from the plugin Taxonomy Images and it’s working: function get_taxonomy_image( $atts ) { $atts = shortcode_atts( array( ‘image_size’ => ‘thumbnail’, ‘id’ => ”, ), $atts ); if( ! empty( $atts[‘id’] ) ) { $term = get_term( $atts[‘id’] ); $related_id = 0; if ( isset( $term->term_taxonomy_id ) ) { $related_id … 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

Generate multiple tag query URLs

$url = parse_url( $your_url ); $query = $url[‘query’]; $args_arr = array(); parse_str( $query, $args_arr ); if( isset( $args_arr[‘param’] ) ) { $query_string = $args_arr[‘param’]; $query_string .= ‘,value2’; } else { $query_string = ‘value2’; } add_query_arg( ‘param’, $query_string ); That’s completely untested, but you get the concept. Basically, wordpress is gonna want to replace what you … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduseduedueduedusedusedusedusedus