I want to display all category in layered navigation in Magento 2.

For example : Clothing I have 3 sub categories then I want to display all three categories with subcategory.

2 Answers 2


enable Anchor option under categories


You need go over:

  1. Stores->Configuration->CATALOG->Catalog.
  2. Show Category Top Navigation
  3. Change this :enter image description here
  • Hi, thanks for replay. It is not working for me if the depth is 0 it is displaying only subcategories of the selected category. I want to display all category and subcategory
    – karthik
    Aug 27, 2018 at 6:18
  • So change the depth to greater, example 4 or 6 or 8, I showed where to change. Aug 27, 2018 at 8:03
  • How to get know where the getItem function is defined in Magento 2.
    – karthik
    Aug 27, 2018 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.