Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.4k views
in Q2A Core by

How i enable show answer form immediately always after answers Stackoverflow style?

Admin--> Viewing  

Show answer form immediately: Always  but Answer form view after question. I want to see after answers as Stackoverflow.

Q2A version: 1.6.3

1 Answer

+4 votes
by
selected by
 
Best answer

Add below function in your theme. This code swaps 'a_form' and 'a_list'.

function main_parts($content) {
  $newcontent = array();
  if(isset($content['a_form']) && isset($content['a_list'])) {
    $a_form = $content['a_form'];
    $a_list = $content['a_list'];
    foreach($content as $key => $item) {
      if($key == 'a_form')
        $newcontent['a_list'] = $a_list;
      else if($key == 'a_list')
        $newcontent['a_form'] = $a_form;
      else
        $newcontent[$key] = $item;
    }
    qa_html_theme_base::main_parts($newcontent);
  } else
    qa_html_theme_base::main_parts($content);
}
There may be more smart code ... In addtion, because it is stupid to answer without reading existing answers, I think this order should be revised in Q2A core.
 
Restrictions:
Pagenation is displayed after answer form. It is necessary to change it more to solve this.
by
"to answer without reading existing answers" Good point, I hope Scott will consider this.
by
Can you please tell me exactly in which file I have to insert this code (and where)? I use ReSnow Theme.

Thanks Fabian
...