This will find all terms in custom taxonomy underkategorier
and then will show terms with post from chosen category.
$taxonomies = get_taxonomies(array('name'=>'underkategorier'),'object');
foreach($taxonomies as $taxonomy) {
$terms = get_terms( $taxonomy->name, 'orderby=count&hide_empty=0' );
foreach($terms as $term) {
$wpq = array ('taxonomy'=>'underkategorier','term'=>$term->slug, "cat"=>10);
$myquery = new WP_Query ($wpq);
$article_count = $myquery->post_count;
echo $term->name.' '.$article_count; //with empty ones
if ($article_count){
echo "<ul>";
echo "<li>".$term->name.' '.$article_count."</li>";
echo "</ul>";
}
}
}
Related Posts:
- Query Posts by Custom Field ‘Price’
- Get product attribute for Simple product in WooCommerce
- Woocommerce custom shared taxonomy
- Can’t create term for product attribute
- WooCommerce shop page orderby [closed]
- Limit Number of Taxonomy Terms (Images) Displayed
- Want wp_get_post_terms return in arbitrarily order, how to do?
- List taxonomy terms for post as checkboxes
- Ordering taxonomies by rank
- WooCommerce search products between price range using WP_Query
- Redirect to another page using contact form 7? [closed]
- How to get a list of bundled products using wp_query in woocommerce
- Getting taxonomy images to display on single-post with their terms
- Where to populate custom terms in custom taxonomy in plugin?
- woocommerce search by sku and title ajax
- wp_insert_term() doesnt insert a term
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- Smarter navigation plugin and custom taxonomies
- Get product categories and add them to a custom taxonomy
- WooCommerce Product Table – filter query on attributes
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Why is my custom taxonomy image not displaying?
- Get only selected custom taxonomy
- Get custom term link archive with prefix
- Add “selected” class to custom taxonomy dropdown search
- Woocommerce Add Variation Product to Cart from custom link [closed]
- WooCommerce – How to Add a Custom Field to Cart Items and Cart Totals [closed]
- Combine two taxonomies in a hierarchical tree
- User profiles and object associations
- Comparisson between date() and a date from wp_postmeta
- How to extract images of post and pages excluding header and logo image in wordpress?
- Is it possible to set up multistore in Woocommerce? [closed]
- How use %like% in sql statement wordpress
- Custom Taxonomy Tag Search
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- WooCommerce E-Check payment gateway disappeared when site switched to multi-site
- FacetWP group listings by custom field [closed]
- WordPress category add image field
- How to configure two SMTP Server for wordpress
- Woocommerce plugin for minimum order and add-to-card-step
- Change wordpress current_time function to different timezone
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Automatically add attributes to woocommerce product?
- Woocommerce API HTTP Response 401
- How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
- woocommerce payment gateway callback not firing [closed]
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- Programmatically Process Order through WooCommerce/Stripe Payment Gateway [closed]
- Filtering WooCommerce Orders by Category
- Checking if a woocommerce attribute is set
- Hide a Menu Item on Login
- How to display terms and conditions in post area?
- Show icons or badges under title on product archives/category pages
- WooCommerce: after install hook
- Check if a post has term inside loop
- how get curent URL slug from archive page [closed]
- BuddyPress activity on edit post for a CPT
- How to add category and subcategory in WordPress custom code?
- Customizing $product->get_title() function
- Woocommerce checkout page broken when set as a checkout in woocommerce settings [closed]
- how to create hierachial taxonomy and manage under single post type?
- WooCommerce – I want to add functionality of one plugin to another plugin — best approach?
- How to make WooCommerce payment method field optional?
- Woo-commerce Update price as a Bulk from My offline software export
- wp_query ‘s’ parameter does not work with WC_AJAX
- how to display recent post by category on home page
- Add Plugin broken after removing Booster for Woocommerce
- Display top level parent category as a single product body class (Woocommerce)
- add a hook of Woocommerce to a plugin but it only shows and doesn’t function properly
- any word search WordPress
- Warning: call_user_func_array() problem can anyone help with it?
- How can I find related learndash course id from woocommerce product object?
- ACF Fields are not showing up on Homepage
- How to create a plugin with automatic update?
- Securing langugae folder
- Add a WooCommerce Product Variant with attributes programmatically
- Use Case: Multiple Shipping Methods per Order
- Fetching users data from REST API
- Automatically check “Enable stock management at product level” to the existing products?
- Change hook to add_action in a plugin class
- Adding/ Removing actions for plugins
- Unable to sync woocommerce variations
- Run one-time script calling plugin functions
- Plugin does not create a custom table upon activation
- Show similar category portfolio items?
- WordPress filter function using query modifications
- Find And Add Category to Posts
- Unable to show 4 products in a row
- Woocommerce quick checkout form [closed]
- Woocommerce Large Variations Shows Out of Stock Items [closed]
- ACF Taxonomy Object term Null [closed]
- Why does theme need woocommerce to show images / content on front page?
- Issue On Listing Woocommerce Parent Tag List
- how do I solve Installation failed: There has been a critical error on your website
- WooCommerce product prices not showing up correctly [closed]
- woocommerce show cities state as dropdown list
- How can I make a quotation engine like this website in WooCommerce?
- ShipStation WooCommerce Integration error
- How do I check if a post has a term with a particular ancestor/parent?
- taxonomy-{term}.php terms pagination returning 404 after a certain page