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

Hi guys,

Really need help for that one. I have an advance theme. I have "Questions"

with submenu : "Most recent" - "Most answer" - "Most view"

How can I delete or change position of "Most recent" ? in order to have only "Most answer" (first) - "Most view" (second)

Thanks a lot!!!

1 Answer

+2 votes
by
selected by
 
Best answer

Add this to your qa-theme.php file:

For 1.7+:

public function initialize() {
    parent::initialize();
    unset($this->content['navigation']['sub']['recent']);
}

For 1.6, you can use the same code but replace initialize with doctype.

In order to avoid getting to the most recent page by default, the easy way, would be to hack the core.

1. Locate this line.

2. Add the following code exactly in that line:

if (!in_array($sort, array('hot', 'votes', 'answers', 'views')))
    $sort = 'X';

3. Edit the previous code so that X takes one of hot, votes, answers or views. Each of them represents one of the menu items. The value you replace X with will be the menu item that will be selected by default when clicking on the Questions menu item.

by
edited by
Hi Pupi,
PROBLEM: It works to delete the most recent button (only) , but the problem is when user click on "Questions", they still have "Most recent list", instead of "Most answer list"!
by
reshown by
I fixe this by choosing "hot" in qa congif, and then in list I choose what is hot, so I can have the list of questions I want.
by
There I provided a way to fix it
by
it works perfect! Thanks!
...