Show the parent taxonomy by creating shortcode in woocommerce?

The Shortcode to display products in “Fruits” category when user is on another page or archive… is: [products category=”fruits”] As far as I know there is no shortcode to display the parent category products without specifying the given category slug. For your 2nd example you will have to call it in your sub category “Pork” … Read more

List of all posts from current category on single portfolio page

Update your following part of code: $term = get_queried_object(); $category_name = $term->slug; //category slug $args = array( ‘post_type’ => ‘portfolio_page’, ‘post_status’ => ‘publish’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘category_name’ => $category_name );

get taxonomies from terms

After some research I came up with the following // Get the posts in that category with the required tag $args = array( ‘post_type’ => [‘documents’,’news’], ‘fields’ => ‘ids’, // Only get post IDs ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘forms’, ‘field’ => ‘slug’, ‘terms’ => $symbol ) ) ); $posts_array = … Read more

Multiple Tag Filtering

I recently wrote a bit of code which filters by one tag at a time only, but it would be pretty easy to modify it to ‘toggle’ the status of each tag so that you could filter by multiple tags simultaneously. You can see it working here: http://sadcookbook.recipes/sad/ . It uses the following PHP to … Read more

Custom permalink structure for custom post types including multiple taxonomy

This code produces the right structure but the post can’t be found (404) That is because the custom rewrite tags (%filter_1% and %filter_2%) appeared as-is in the generated rewrite rules (in the database). So you need to register the tags so that they’re replaced with the proper RegEx (regular expression) pattern when WordPress (re-)generates the … Read more