Home wordpress WP WOOCOMMERCE Category Display

WP WOOCOMMERCE Category Display

Author

Date

Category

how can I display a product category, for example, on the main page, I thought to use the rpwe plugin, but it displays posts …
I would like to display categories as the top category in the store, please help


Answer 1

Product Category is the “user taxonomy” product_cat used by WooCommerce products.

You need to use get_terms () with the correct taxonomy, like this:

$ categories = get_terms (['taxonomy' = & gt; 'product_cat']);

Well, you can display it in index.php either in the page template or wherever you want.
I hope I understood the question correctly.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions