Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How do I hide the categories number count in the side bar?

0 votes
asked Oct 7, 2011 in Q2A Core by anonymous

In qa-theme-base.php page, I changed this line from:

$this->output('<SPAN CLASS="qa-'.$class.'-note">'.$navlink['note'].'</SPAN>');


$this->output('<SPAN CLASS="qa-'.$class.'-note">'.'</SPAN>');

It hide the categories count in the side bar but when I browse the category page. It don't have any links to the categories.

So, on this line I change from:



this->output($navlink['label'].'<SPAN CLASS="qa-'.$class.'-note">'.$navlink['note'].'</SPAN>');


Now, I am getting this error when I am NOT loggin:

Notice: Undefined index: note in /home/clicks/public_html/haveanyquestions.com/qa-include/qa-theme-base.php on line 441

If a logged in there is NO error message.

Can anyone help me?


2 Answers

0 votes
answered Oct 8, 2011 by rajul885

In function function nav_link($navlink, $class)

just remove last two line


if (strlen(@$navlink['note']))
$this->output('<SPAN CLASS="qa-'.$class.'-note">'.$navlink['note'].'</SPAN>');
it works for me
your funtion would look like this:
function nav_link($navlink, $class)
if (isset($navlink['url'])) {
'<A HREF="'.$navlink['url'].'" CLASS="qa-'.$class.'-link'.
(@$navlink['selected'] ? (' qa-'.$class.'-selected') : '').'"'.
(isset($navlink['target']) ? (' TARGET="'.$navlink['target'].'"') : '').'>'.$navlink['label'].
} else
commented Oct 8, 2011 by asianfever
I removed the last two lines and yes it did work BUT if you go to the "Browse categories" page, the links next to the categories name will be remove too.

For example,

Before the change:
Arts & Humanities - 0 questions

After removing the last two lines:
Arts & Humanities
commented Feb 14, 2013 by tonci
If you want links in "Browse categories", instead of deleting these two lines, you can replace them with this:

if (strlen(@$navlink['note']) && $class != "nav-cat") $this->output('<SPAN CLASS="qa-'.$class.'-note">'.$navlink['note'].'</SPAN>');
0 votes
answered Feb 15, 2013 by jatin.soni

Very simple way to do is just add display:none property to .qa-nav-cat-note in css :P