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
2
votes
1 answer

Replace WooCommerce product price with a text for unlogged users and a specific product Tag

In WooCommerce, I use the following code: get_id(), 'product_tag' ); for ($i = 0; $i < count($terms); $i++) { $tags[] = $terms[$i]->slug; } ?>
user10201522
2
votes
1 answer

Exclude a product category from Related products in WooCommerce

I am trying to exclude a product category (id: 78) from the related products section in WooCommerce. I have a custom query already in place which only shows related products from the child category. This is my code:
dwinnbrown
  • 3,789
  • 9
  • 35
  • 60
2
votes
1 answer

How can I list all available product attributes and terms using WooCommerce REST API?

I am trying to get all product attributes by WooCommerce REST API using the following code: $current_attributes = $woocommerce->get('products/attributes'); However I always receive up to 10 attributes maximum. I tried a several variants…
2
votes
1 answer

Auto assign Woocommerce Product Categories from Product Tags on import

I am trying to set automatically Woocommerce Product Categories from Product Tags when importing products using WP All Imports plugin. For example: I am importing specific breadcrumb slugs as Product tags: Sports/Shoes/Running Shoes > Now I wanne…
2
votes
2 answers

Hide a variation attribute value in Woocommerce variable product dropdown

I want to hide specific variations from being shown in the dropdown of woocommerce product pages. I was able to hide the "choose an option" but I am struggling with doing the same for the value="2,5 kg" for example This is my code for hiding "choose…
Krystian
  • 887
  • 5
  • 21
  • 52
2
votes
1 answer

Display the product shipping class on Woocommerce single product pages

I'm trying to display the shipping class on product page but I must do something wrong because nothing shows.. I used the bellow code in function.php: add_action('woocommerce_single_product_summary', 'display_specific_shipping_class', 15 ); function…
Helen_zs
  • 75
  • 2
  • 10
2
votes
1 answer

Display New Badge Woocommerce If In New Category

I need to display a 'new' badge to product on the archive page but only for products in the 'New' category add_action( 'woocommerce_after_shop_loop_item_title', 'lottie_new_badge', 40 ); function lottie_new_badge($badge) { global $product; if…
FoamyMedia
  • 486
  • 3
  • 14
  • 32
2
votes
2 answers

Add a custom field to Woocommerce products for a specific product category

I'm trying to add a custom field to the single product page for products in a specific category. I'm having problems with the conditional logic tho. This is what I've got so far: function cfwc_create_custom_field() { global $product; $terms =…
Paudun
  • 287
  • 1
  • 6
  • 15
2
votes
3 answers

Get the parent product categories ids from a sub product category ID in Woocommerce

For example : - A = 21 - B = 22 - C = 23 How can I get 21 and 22 IDs using 23 sub Id?
2
votes
0 answers

WordPress - Display categories, duplicate parent item and show as a child if there are children

I'm having issues with customising the Custom Walker. What i'm trying to do is create an accordion menu where the first parent opens up the child list which also as the parent repeated so it can be clicked on. Parent 1 - Parent 1 - Child 1 -…
2
votes
1 answer

Wordpress taxonomy query with both and , or condition

i have product post type and i have product_cat is the taxonomy . In product_cat i have red, hard, soft, pen entires . So i have to get the products coming under red and it coming hard or soft How can i get this ? For a product that come under…
Abilash Erikson
  • 341
  • 4
  • 26
  • 55
2
votes
1 answer

WP_Term_Query - How to search only beginning of term name?

I'm building a WordPress autocomplete search which uses custom taxonomy terms as suggestions, and I'm using WP_Term_Query to query for the terms from what the user types in the search field. WP_Term_Query has a parameter called "search" which…
2
votes
1 answer

On taxonomy page, show posts associated with that taxonomy and another

I have a custom post type called Developments. They are buildings. They have two different taxonomies: City and Status. On the City taxonomy page for one of the buildings I'm trying to show all posts associated with the Status taxonomy.
Darren Bachan
  • 735
  • 2
  • 11
  • 30
2
votes
2 answers

How to show more than 1 custom taxonomy term or link on a custom post type?

I have created a custom taxonomy called 'tema' and the taxonomy has three terms. I want to show ALL the term links that are related to the current post. Currently I can only get my code to show ONE of the posts taxonomy terms... I would like the…
MariaThiim
  • 21
  • 2
2
votes
2 answers

Sort terms on custom taxonomy by custom metadata (pre_get_terms)

I have created a custom taxonomy called 'attach_cats' for media attachments. Each term in the taxonomy has custom term metadata with a key of 'term_order' and meta value of an integer. I have added a custom column to the "edit-tag.php" page that…
Jeremy
  • 239
  • 2
  • 14