theme functions php code question
-
I have this little line of code that I use to add the words “pair” next to my product quantity for a specific category. I am trying to understand how I could define multiple categories that this would affect, rather then just one. Ive tried several different ways of modifying it, but no luck. TIA
add_action('woocommerce_after_quantity_input_field', 'wc_text_after_quantity'); function wc_text_after_quantity() { if ( is_product() && has_term( 'your_category', 'product_cat' ) ) { echo 'pair'; } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘theme functions php code question’ is closed to new replies.