Questions tagged [taxonomy-terms]

Terms are usually associated to custom taxonomies in Wordpress

Use this tag if you mean terms used for custom taxonomies in Wordpress

486 questions
3
votes
1 answer

Hide product price and disable add to cart for specific product categories in Woocommerce

I'm looking for the right code that hides the prices for some specific categories in Woocommerce. I already have the code to hide the prices on de single product page: add_action( 'wp', 'remove_prices_based_on_category' ); function…
JensM
  • 31
  • 2
3
votes
1 answer

Get product category for every item of a WooCommerce order

I can retrieve almost every metadata of the order items but I want to retrieve the category of the items too. My code now has this: foreach ($order->get_items() as $item_key => $item_values) { ## Using WC_Order_Item methods ## // Item ID…
PelHout
  • 83
  • 1
  • 12
3
votes
1 answer

Sort product attribute terms using WooCommerce wc_get_product_terms function

I have an eCommerce website powered by WooCommerce. I'm using product variations to allow my customers to choose a specific configuration for their product. I'm using the following code to list the terms names of a specific product…
3
votes
1 answer

Exclude Woocommerce products in recently viewed products widget from a product category

I'm trying to figure out how to exclude product in a category from Recently Viewed Product Widget in Woocommerce. I know products in a category can be removed/hidden from shop page using the below code function custom_pre_get_posts_query( $q ) { …
3
votes
4 answers

Nested wordpress terms list - filter

I've made a custom term taxonomy in Wordpress with the plugin CPT UI. So I'm able to add "Product categories" to my Custom Post Type "Product". We have a parent categories and child categories. For example: *Toegangscontroles Electronische…
Dennis
  • 528
  • 3
  • 24
3
votes
3 answers

How can exclude term from get_terms by term name not by term id

My code below. It does not work to delete using the terms. I need it to work like this and not delete by ID. $terms = get_terms( 'MY_TAXONOMY', array( 'orderby' => 'name', 'order' => 'ASC', …
J.Z
  • 57
  • 1
  • 1
  • 10
3
votes
3 answers

Wordpress - taxonomy used on multiple post types - how to get_terms / get_categories for just one?

I have registered taxonomies for multiple post types thinking this was the best way to set the site up rather than have the same taxonomies duplicated. However, now I have run into an issue where I need to list the used taxonomies for a post type…
LeeTee
  • 6,401
  • 16
  • 79
  • 139
3
votes
3 answers

wp_list_categories() - display first level categories and only current term's children in subcategory page

I'm using WordPress. Have multiple categories with its subcategories. In general page, I'm displaying all first level categories. Here is my code: $args = array( 'type' => 'product-items', 'child_of' => 0, 'parent' => '', 'order' =>…
aiddev
  • 1,409
  • 2
  • 24
  • 56
3
votes
3 answers

Excluding Specific Terms from WP_Query

I would like to create a foreach loop for taxonomy terms which is for custom post type. More specifically I want a loop that queries all the products categories, but not the category "special-offers" and not categories subcategories. Bonus would be…
Jack
  • 108
  • 1
  • 2
  • 9
3
votes
1 answer

If has_term, load other Wordpress theme

This is what I want to accomplish. In Wordpress I've created a taxonomy called categorie with the terms app, web and branding. When a project has the term app, I want to load another theme / blog. When a project has the term web or branding, I want…
yluijten
  • 123
  • 2
  • 8
2
votes
1 answer

How to count the number of sub-terms under each parent term in WordPress

I want to count the number of sub-terms under each parent term in WordPress. I have created a custom taxonomy in WordPress. I would like to display all the terms of this custom taxonomy on a custom page, such as: 1. I want to display all sub-terms…
2
votes
1 answer

WooCommerce cart items price suffix for specific product category

I need to add a suffix text to the price of a woocommerce product from a specific category while on WooCommerce cart. Here is my code: add_filter( 'woocommerce_cart_item_price', 'filter_woocommerce_cart_item_price', 10, 3 ); add_filter(…
Ñako
  • 33
  • 2
2
votes
1 answer

Display loop product category items description below their title in WooCommerce

I would like to know how would one add the category description underneath the category title on the woocommerce shop by category page? Here is what I've tried" function woocommerce_after_shop_loop_item_title_short_description() { global…
2
votes
1 answer

Display WooCommerce related products based on specific product attribute value

I am trying to get displayed related products based on specific product attribute "pa_kolekcja" term value (set on the product). I have a following piece of code (it's almost ready): function woo_related_products_edit() { global $product; …
Tim
  • 87
  • 1
  • 8
2
votes
1 answer

WooCommerce how to update product category description and thumbnail ID

I've got an array of data with which I'd like to update my products categories (taxanomy) metadata. Specifically, I'm trying to update description as well as thumbnail url values. I tried to use multiple wordpress functions but none of them worked!…
Ruvee
  • 8,611
  • 4
  • 18
  • 44
1 2
3
32 33