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
- Create a custom taxonomy’s term form
- Query Custom Post Types on Available Dates
- Shipping Refund via Stripe Creates New Order Instead of Updating Original Order
- Show Heirachy of categories in WP Download Monitor
- Custom Taxonomy Tag Search
- Add custom taxonomy to title tag [closed]
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- WP_Query ordering numbers as letters
- Need Old Version of plugins
- Get child product categories from parent product category in WooCommerce
- WooCommerce E-Check payment gateway disappeared when site switched to multi-site
- Manually add order item with fixed product_id in WooCommerce
- Woocommerce email template customization [closed]
- FacetWP group listings by custom field [closed]
- How can I display a contact form for out of stock products in WooCommerce?
- Remove specific product from shop in woocommerce [closed]
- woocommerce_order_status_completed action hook not working [closed]
- How to update billing_email when user_email is updated [closed]
- HTML in WooCommerce settings
- How can i list random post from multiple category?
- how do i remove posts from a WP_Query so the pagination is right?
- WP plugins for building a database?
- Serve different files depending on OS/Browser
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Accessing post’s meta data based on user’s click of a post
- Function get_queried_object() return NULL in custom taxonomy
- WordPress category add image field
- How to configure two SMTP Server for wordpress
- Absolute Image URL in srcset is appended to the upload dir
- Dropdown menu on custom page with product to choose number of products per page
- Where (or when) should I register a new taxonomy?
- Woocommerce plugin for minimum order and add-to-card-step
- Add Product Subtitle to Woocommerce Product Page
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Change wordpress current_time function to different timezone
- Only Homepage not loading properly
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- showing all search result in one template
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- woocommerce 3.2.1 not sending order notification emails
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- Integrating non-WooCommerce and WooCommerce Orders together [closed]
- Widget for adding HTML markup to a page
- Change the method of a class from child function.php
- How I can get custom field’s current value?
- Override Javascript in a Plugin?
- Filtering WP_Query Dynamically on the Front-End
- WooCommerce Custom Product to checkout
- Woocommerce – How to populate custom select field with stored values on checkout page?
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Get posts from WP_Query and format them on admin_head
- Automatically add attributes to woocommerce product?
- Reduce Drop down Menu Width in WordPress
- Get custom category image from menu
- Not getting author rank when using return
- How to query the custom fields by language?
- How do I “get the next 10 posts after post_id == x”?
- switched from query_posts to WP_query, not working now?
- AJAX search posts and pages
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- DROP TABLE with uninstall hook not working
- How to enable specific plugin only based around shop manager role?
- What are wsm tables for?
- WordPress automatically removes line break
- Why required field not working in Country dropdown in WooCommerce –
- Woocommerce API HTTP Response 401
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
- Add woocommerce variation images in gallery?
- ‘No Results Found’ on single post for custom post type
- woocommerce payment gateway callback not firing [closed]
- How to modify WCMP Rest API response?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- How to change this WP_Query to get all ProductIDs and not only specific one?