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 multiple taxonomies
- Create WooCommerce Product Category Programmatically
- Sort the main query in subcategories/terms?
- Find out if request is for custom post type archive before query runs
- WooCommerce Dynamic Cart Pricing
- Add multiple attributes to product from php
- Only Homepage not loading properly
- showing all search result in one template
- woocommerce 3.2.1 not sending order notification emails
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- How I can get custom field’s current value?
- Woocommerce – How to populate custom select field with stored values on checkout page?
- AJAX search posts and pages
- WordPress automatically removes line break
- Add woocommerce variation images in gallery?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- How to toggle between two custom fields in WordPress woocommerce ‘WC Product Field Group’ plugin?
- Why am I getting ( WooCommerce Services could not be installed (Could not create directory.). ) error and how to solve it ?
- how to do login using woocommerce rest api From android
- How to create a custom shortcode based on the layout?
- “Custom Post Type Permalinks” plugin URL strcuture
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- Exact Hook to payment methods
- Adding Static Image to WooCommerce Content-Single-Product template
- Error in pdf generating plugin using FPDF
- How to add a new column with text fields to WooCommerce Cart List?
- Woocommerce: limit user to see only the products he created
- Exclude product attributes from taxonomy terms loop
- How do I get the Payzone WooCommerce payment gateway plugin to show up in the settings? [closed]
- Error with get_price (and others) in self-written plugin to show price
- How to change WooCommece variation data programmtically [closed]
- .php file for woocommerce edit category? [closed]
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- Loop returns the current page’s permalink and guid instead of the post in the loop
- Woocommerce Free shipping method [closed]
- dynamically create callback functions inside a for loop
- Wp_query…a type of term a different div
- How to find the WordPress Nextgen galleries which are not used in WordPress posts?
- Rename existing cpt and taxonomy with new textdomain
- WordPress Phone Field Check (use numbers, spaces and pluses)
- Can export gallery but can’t import it Wp all import
- How to Get Category Name When Export Products
- Plugins to generate reflinks in WordPress
- WoCommerce Cart is not showing pricing
- What database state changes happen after a post is manually “updated” with no changes?
- Display posts by alphabetical order
- Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /../plugins/rm-payment.php
- How to Fix WordPress multisite woocommerce 403 file error
- Adding discount functionality to the cart
- How to find the file path in WordPress?
- Woocommerce Attribute price for non-variations
- Change Woo Custom Endpoint Titles from a Plugin
- Woocommerce functions in custom class, avoid errors
- How Can I display Specific User Pages?
- Saving data only when payment is successful
- How to use information from the database in the front-end?
- Taxonomy Category Icon on index page
- Template conflict with WC Payment Method
- Get value from an input field and pass into update_meta_data as $meta_value
- Making Woocommerce optimized for more than 500k products
- History of page, interval of years
- Get posts of an specific term of a custom taxonomy
- How to allow customers to input a text as a product variation *and* charge per character?
- “Tree view” for wp_dropdown_categories() markup
- Can’t pull metadata for a term in my theme’s function.php
- WP-Snap too slow (caused by WP_Query?)
- Award points if a specific custom taxonomy is selected – Cubepoints
- Checking url from plugin [duplicate]
- WooCommerce custom query and paging: Not Found error
- WooCommerce & WooCommerce Shopee Intergration
- Am I allowed to resell WordPress Premium Plugins under GPL? [closed]
- which plugin is this? [closed]
- Adding a script & php to functions.php
- Override the plugin class and function