dimanche 22 mai 2016

Display sibling categories in WooCommerce

On my WooCommerce website, I have the following Product categories:

• Clothing
  - Tee shirts
  - Jeans
  - Shirts

• Food
  - Bread
  - Cheese
  - Butter

On the category page for "Butter" I would like to show the name of the parent category and the sibling categories of the category "Butter". This would look like this:

<h2>Food</h2>
<ul>
   <li>Bread</li>
   <li>Butter</li>
   <li>Cheese</li>
</ul>

Similarly, the category page for Jeans should show:

<h2>Clothing</h2>
<ul>
   <li>Jeans</li>
   <li>Shirts</li>
   <li>Tee Shirts</li>
</ul>

How would I achieve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire