Skip to content

Instantly share code, notes, and snippets.

@DxDiagDx
Last active August 4, 2020 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DxDiagDx/31c25ac7f16efacd0d34757e7f6c2354 to your computer and use it in GitHub Desktop.
Save DxDiagDx/31c25ac7f16efacd0d34757e7f6c2354 to your computer and use it in GitHub Desktop.
Woo: условие вывода для товаров отдельной категории
add_action( 'woocommerce_after_single_product_summary', 'bbloomer_single_category_slug' );
function bbloomer_single_category_slug() {
if ( has_term( 'chairs', 'product_cat' ) ) {
echo 'Something';
}
elseif ( has_term( 'tables', 'product_cat' ) ) {
echo 'Something else';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment