Include taxonomy slug in url?

This can be a bit challenging for WordPress, because it wouldn’t know whether you are referring to post, page or taxonomy. Nevertheless, rename your taxonomy to something like product_category and try changing the slug in your post type arguments to system/%product_category%, and slug in your taxonomy arguments to just system. WordPress should now handle /system/your-product-category/post-name/ … Read more

Custom post query by taxonomy

I’m slightly surprised that the first would work, because it’s terms, not term. Anyway, the correct way to do this is: $args = array( ‘post_type’ => array(‘product’, ‘comic’, ‘magazine’), ‘tax_query’ => array( array( ‘taxonomy’ => ‘Genres’, ‘terms’ => array( ‘hot’, ‘home’ ), ), ‘posts_per_page’ => 10 );

Set posts_per_page in WP_Query for custom taxonomy

Your WP_Query is formed incorrectly. See WP_Query Taxonomy Parameters. Try this code: <?php $post_type=”page”; // Get all the taxonomies for this post type $taxonomies = get_object_taxonomies($post_type); // names (default) foreach( $taxonomies as $taxonomy ) : // Gets every “category” (term) in this taxonomy to get the respective posts $terms = get_terms( $taxonomy ); echo ‘<div … Read more

RSS feed for dynamic set of custom taxonomies terms

Code Tricks have an article on this. The article is so short that quoting it will essentially copy it: //URL to fetch RSS feeds for custom post type feeds. www.your-website.com/feed/?post_type=custom_post_type_name //URL to fetch RSS feed for custom post type feeds including the custom taxonomy. www.your-website.com/feed/?post_type=custom_post_type_name&taxonomy_name=taxonomy //This is just an example. www.code-tricks.com/feed/?post_type=tutorials&tutorials_category=javascript Please do see the … Read more

‘category__and’ for custom taxonomy?

I think this question can cause a misunderstanding. You say: I want to retrieve all the posts that have custom taxonomies ‘taxonomy-1’ and ‘taxonomy-2’ but do you want post that have both taxonomy-1 and taxonomy-2 and taxonomy-3 is irrilevant? $args = array( ‘post_type’ => ‘post-type-x’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘taxonomy-1’, … Read more

Paginated Taxonomy Term Archive including one post per term

As discussed in chat and as @Rarst already told you, there’s no default WordPress way to accomplish Archive of multiple taxonomies and all their terms In fact there’s no way to accomplish Archive of single taxonomy and all its terms in WordPress. Simply because WordPress doesn’t do that – without custom SQL queries. But there’re … Read more

Woocommerce custom shared taxonomy

Found solution for this problem. It turned out that woocommerce affects post_type query variable in pre_get_posts filter without checking that another post_type has been requested. It’s done in WC_Query.product_query method: if ( ! $q->is_tax( ‘product_cat’ ) && ! $q->is_tax( ‘product_tag’ ) ) $q->set( ‘post_type’, ‘product’ ); Fix for this problem is simple. You just need … Read more