Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.1k views
in Q2A Core by
Hi

Currently all categories with counts and feed icon showing in sidebar ..

How i can modify it for following:

Only Categories name required

How to remove counts and feed icons
Q2A version: latest

1 Answer

+1 vote
by
edited by
 
Best answer

To remove the feed you should make sure there is this function in your qa-theme.php:

function feed() { }

Yeap, it is empty.

In order to remove the category counts then you'll have to add a new function to handle the recursion and make sure your doctype() function is similar to the one below, again in the qa-theme.php:

private function remove_category_count(&$category) {
   unset($category['note']);
   if (isset($category['subnav'])) {
      foreach ($category['subnav'] as $name => $dummy_category) {
         $this->remove_category_count($category['subnav'][$name]);
      }
   }
}
 
function doctype() {
   qa_html_theme_base::doctype();
   if (isset($this->content['navigation']['cat'])) {
      foreach ($this->content['navigation']['cat'] as $name => $category) {
         $this->remove_category_count($this->content['navigation']['cat'][$name]);
      }
   }
}
 
Note this is a blind shot. I don't know what your qa-theme.php file looks like. So make sure you backup the file, just in case.
by
second part is working fine.
first part is not removing feed icon..
but anyways thanks for the great help
by
Welcome. Anyway, if you're trying to remove the "Recent questions and answers" below the categories the empty feed() should do the trick. Another alternative would be to add this:

unset($this->content['feed']);

To the doctype() function. Something like this:

function doctype()
{
    qa_html_theme_base::doctype();
    unset($this->content['feed']);
    $categories = isset($this->content[ ... etc ...
by
function doctype()
{
  qa_html_theme_base::doctype();
  $categories = isset($this->content['navigation']['cat']) ? $this->content['navigation']['cat'] : null;
  if (isset($categories)) {
    foreach ($categories as $name => $category) {
      unset($this->content['navigation']['cat'][$name]['note']);
    }
  }
}

This remove only main category counts but bot for subcategory and subsubcategories. How i can delete the same
by
I've updated the answer to remove it from any number of subcategory levels
by
Sub categories function not working
by
pl combine full code
...