add_action( 'wp', 'vn_remove_related_products' );
function vn_remove_related_products() {
if ( is_product() && has_term( array('workshops', 'events'), 'product_cat' ) ) {
remove_action( 'woocommerce_after_single_product_summary',
'woocommerce_output_related_products', 20 );
}
}
Function has_term()
can pass first parameter as array with terms.
Related Posts:
- How to get current product category ID in product archive page
- WooCommerce prices location in DB
- WP/WooCommerce REST API cart/checkout/order [closed]
- Fatal Error when installing woocommerce despite upgrading
- Adding an action within a function that is being called by add_filter
- Hide Add to Cart Button
- How to modify “[Product] has been added to your cart” in WooCommerce?
- woocommerce fail to replace template string in email title [closed]
- Why do Woocommerce templates use hooks rather than get_template_part
- Woocommerce checkout via external page [closed]
- Change font size in products listing pages in woocommerce
- Display WooCommerce only in stock sizes product attribute on shop page
- How to stop a Gutenberg Block from firing multiple GET Requests?
- Woocommerce Product Price Inserted programmatically doesn’t get displayed In Single Product Page
- How to Order by random on a SQL query
- Trying to disable slider for WooCommerce price filter [closed]
- Hide “Delete Note” link in Order Notes Panel
- Exclude products with a stock lower than the low stock threshold from the shop loop [closed]
- Remove Order List Row Link in WooCommerce Admin?
- Woocommerce: custom loop in product tabs breaks reviews tab
- Category Tree In WooCommerce Product API
- Programatically Remove Item from Cart Not Working – Needs Page Refresh
- How to delete 1000s of duplicated images in WordPress?
- Set default value field meta_Value [closed]
- Woocommerce Product Import Automation
- Get posts from subcategory by parent category slug
- how to get jetpack’s infinite scroll to work with woocommerce?
- Check if page is a woocommerce attribute
- DELETE WooCommerce Order data from database
- How do I update every title of a certain category with a phrase
- Change max number of products on shop pages
- WooCommerce: One term for Many Product Attributes
- CF7 Ajax isn’t working when called inside WooCommerce “woocommerce_before_add_to_cart_button” hook [closed]
- How to dequeue script on woocommerce product?
- How to output woocommerce products to a page, style and modify the html structure
- Else: Show Message Outside of Product Loop
- Clients with empty username are not receiving request new password email
- how can i add an additional action into woocommerce admin order page through my plugin?
- Variation Swatches for WooCommerce – too many variations
- How to make an edit to an already published post back to Draft
- Display data when category is empty
- Disable woocommerce PLACE ORDER button if user selected products that are not available for international delivery
- Remove sale signs from site in branded? [closed]
- Images not uploading on product page of woocommercr
- How to access WC()->cart in CF7 hook wpcf7_special_mail_tags
- How to integrate e-transfers with checkout in WooCommerce
- Manual Admin Orders search for billing_company
- Use woocmmerce function on theme and override them
- Send all emails to Shop Manager along with admin
- Snippet to copy product affiliate link to a custom field
- Woocommerce Checkout Page Total Price Inside Google Pay Script
- How to hide order action button after changing order status to completed
- How to get rid of variations with unspecified attributes
- Deregister dequeue JS scripts except on 1 product page
- Registration roles
- Change password notification email
- How to show price update date in product single page?
- Woocommerce Rest API: woocommerce_product_invalid_image_id
- How do I disable “Flat Rate” radio button and remain with other shipping method in woocommerce
- How to add woocommerce product price filter widget to other page
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- How do I make my products on the homepage responsive?
- How to get users data from wordpress woocomerce database to display
- Simple thing esc_url query
- Woocommerce on Subdirectory
- Change WooCommerce state and city checkout fields to dropdowns related to the chosen country
- How to apply a custom coupon to a WooCommerce Subscription recurring amount?
- How to send an automatic email to a custom field in Woocommerce order meta 2 weeks after a product is bought
- How to customize product at cart page
- WooCommerce Storefront site-header padding
- WooCommerce: How can I add a certain product to the cart and redirect to the cart from a non-shop page?
- Make Woocommerce breadcrumbs show up using functions.php file
- Alter the cost of products using phpmyadmin sql query
- How does one allow any customer to process any order in store on woocommerce?
- WooCommerce CSV Image URL Creates Additional Images in Media Folder
- Custom changes performed on WP + WooCom site on maintenance subdomain. How to perform a migration to a main domain?
- Update products with curl (bash)
- Create woocommerce order on new user registration
- How to put a date range in a virtual/downloadable product? [closed]
- Woocommerce Child Category Permalink Structure Change
- Allow customer to choose an optional free/paid product to add to their order (and reduce stock reduced & record sale)
- How to restrict type/size of file uploads in any plugin?
- In woocommerce some products have empty options, but how to check this
- Stop the “upload file size” error from printing [closed]
- Redirect whole website or pages to /wp-admin in wordpress
- Changing sale price programmatically, but it’s not shown on front-end
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- WooCommerce – Inconsistent Indexing of Orders
- How to show woocommerce login / registration form in modal
- How to remove slug from Product category URL in Woocommerce
- Removing ‘woocommerce-no-js’ class from body
- url rewrite doesn’t load woocommerce product
- Send data to external websites when there is an update or create a post
- Sort by price when price is set in multiple keys
- Add a custom code with custom link after add to cart for every product
- WooCommerce product permalink based on product’s current category
- Disable duplicate WC product category URLs
- how should i get products based on tags in woocommerce
- Add custom text to product category page
- Woocommerce permalink URL change in DB