Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, needing some wordpress & woocommerce help here.

In content-product.php , I’ve seen this code echo all product categories for each loop product.

PHP
<?php if (etheme_get_option('product_page_cats')): ?>
            
                <div class="products-page-cats">
                    <?php 
                        $size = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
                        echo $product->get_categories( ', ' ); 
						
                    ?>
                    
                </div>
	        <?php endif ?>


The line
PHP
echo $product->get_categories( ', ' );
display all categories under that product.
What if I want to hide certain product category name from displaying. What code should I add?

What I have tried:

- Some googling on display certain woocommerce product category, but no useful result.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900