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

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

Code to show categories at top of sidebar on all pages?

+2 votes

I've found an earlier post (see below), but I'm unsure exactly what code to put in the qa-theme.php file to achieve this. Can someone please cut'npaste the code I should be using in Q2A v 1.3.3?

Thank You

 

Use an advanced theme to override the sidepanel(...) function. In your version, check if $this->content['navigation']['cat'] is empty. If so it means that a category list hasn't been passed through to the theme, and you need to create one. In that case you want to set it up as follows:

global $qa_db;

$categories=qa_db_single_select($qa_db, qa_db_categories_selectspec());

$this->content['navigation']['cat']=qa_category_navigation($categories);

Then your overriding function should call the default sidepanel(...) one as usual.

asked Mar 18, 2011 in Q2A Core by anonymous

Please log in or register to answer this question.