Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+9 votes
451 views
in Plugins by

I am trying to hide the subcategories from the categories list widget but I cant make it work. I know i can simply remove this line:

'subnav' => qa_category_navigation_sub($parentcategories, $category['categoryid'], $selecteds, $pathprefix.$category['tags'].'/', $showqcount, $pathparams, $favoritemap),

 but this will remove subcategories from everywhere they are listed in the site and not only from widget. I tried to override the function

qa_category_navigation_sub()

by calling it inside the widget but this also didn't work. @Ansgar and other developers of q2a could please give me some help. I am really struggling with this. Thanks in advance.  

Q2A version: 1.8.6

1 Answer

0 votes
by

You could do this with CSS:

.qa-widget-side ul.qa-nav-cat-list > li ul.qa-nav-cat-list {
    display: none;
}

Change the  .qa-widget-side  class accordingly to your needs. Top/Side/Bottom.

by
Thank u for your answer mate. I would like to do it by overriding the function. However temporarily I created a new function in the format.php file and works fine but I am sure that there is a way to do this by override the specific function. Maybe someone did this before.
...