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

How do I remove the link "Ask a question" from the navigation?

0 votes
How do I remove the link "Ask a question" from the navigation?
asked Aug 25, 2011 in Q2A Core by G4

2 Answers

+1 vote
I wouldn't recommend it (that's why it's not an admin option) but you could always target CSS class qa-nav-main-ask in a custom theme.
answered Aug 25, 2011 by gidgreen
–1 vote
You could also target the "ask" key:

        function nav_item($key, $navlink, $class, $level=null)
        {

                if($class == 'nav-main' && $key == 'ask') return false;

...
answered Aug 25, 2011 by NoahY
edited Aug 26, 2011 by NoahY
Thanks for your help, it came out like this:

        function nav_item($key, $navlink, $class, $level=null)
        {
           
            if($class == 'nav-main' && $key == 'ask')
                return false;
            else
                qa_html_theme_base::nav_item($key, $navlink, $class, $level=null);
        }

P.S. continue did not help
Oh you're so right :)  I've edited my answer accordingly.