Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.6k views
in Q2A Core by
I'm using a different button, so I don't need the Ask a question button in the navigation menu anymore.

How can I remove it?

 

I've tried a couple of things but I didn't succeed :-(

1 Answer

+5 votes
by
Try this:

Override nav_main_sub() function in qa-theme() to remove 'Ask' tab.

function nav_main_sub(){
            unset($this->content['navigation']['main']['ask']);

            $this->nav('main');
            $this->nav('sub');

}
by
thanks! that worked just fine.
by
awesome! thanks
by
why it wont work for me?
i put it after function_nav_user_search
---->*/
          class qa_html_theme extends qa_html_theme_base
    {
        function nav_user_search() // reverse the usual order
        {
            $this->search();
            $this->nav('user');
        }
    }
      function nav_main_sub(){
            unset($this->content['navigation']['main']['ask']);

            $this->nav('main');
            $this->nav('sub');

}     
but it still show up..
by
edited by
One } too much. You close the class before you put your function - that's it doesn't work. You need to delete } that is just before nav_main_sub() function.

EDIT: oh, and you need to add } after your function (too close the class).
...