troubleshooting Question

Need Help Placing Link On WooCommerce Products

Avatar of sharingsunshine
sharingsunshineFlag for United States of America asked on
Web Development* woo commercePHPWordPress
6 Comments1 Solution124 ViewsLast Modified:
I am using WooCommerce 3.5.6 and WordPress 5.0.3 on a local Xampp system.  I need to put some links at the top of each product page that relates to the digestive system and immune system category.  Here is a screenshot of one of the category names.

Here is my code

add_action( 'woocommerce_before_single_product_summary', 'thp_single_category', 11 );
function thp_single_category() {
if (is_product_category('Digestive System') ) {
	echo 'Something else';
echo '<a href="/digestive-process-sp-266">The Digestive Process</a>';
} elseif (is_product_category ('immune system')){
echo 'Something else';

Can anyone tell me why this isn't working?
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros