OnPoint Plugins

  • Plugins
    • Advanced Sidebar Menu
    • Go Live Update Urls
  • About
    • Services
    • Showcase
  • Blog
  • Contact
  • Support
  • Log In
← Back to support

Use current category as top level parent

Resolved

Requested: 1 month and 1 week ago

Hi!

Would love your help adjusting the sidebar a little bit to fit our needs.

We have a WooCommerce website with 3 levels of productcategories, for example:

  • Main: Balloons
  • Sub: Ages, Birth, Colors, etc.
  • Sub sub (of Ages): 1 year, 2 years, 3 years, etc.

Current situation

On the main category, it is showing al subs -> great.

But when going to a sub, it is still showing the same items like I was on the main category.

Desired situation

  • When on the main category, the menu shows only the subs of that category -> done.
  • When on a sub, the menu shows only the sub from that subcategory (the subsubs).
  • When you are on the subsub, this is the last level. So it would be very nice to show there all its sisters/brothers of that subsub

Hope I explain my request correct. Please let me know if this is workable 🙂

Kind regards

Plugin: Advanced Sidebar Menu

  1. OnPoint Plugins

    1 month and 1 week ago

    Hi Maurice,

    Adding the following filter to your active theme’s function.php file will make the following adjustments.

    1. Use the current category as the top level category.
      1. Allows the menu to show only the categories below the current one.
    2. When on a bottom level category, use the current categories parent as the top level category.
      1. Allows the menu to show the bottom level categories only.

    Note: To prevent showing the current top level categories, you will need to have “Display the highest level parent category” unchecked (like you currently do).

    Have a great day!

  2. Maurice Herpst

    1 month and 6 days ago

    Hi,

     

    I tested the code and it works perfectly.

    Many thanks 🙂

     

New Response Cancel reply

You must be logged in to respond. Only PRO members are allowed to respond to support requests.

© 2023 · WordPress Development · Terms Of Service · Privacy Policy · Cookie Policy · Log in

  • Plugins
  • Blog
  • Contact