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

For insert advert code under question im use this function:

function a_list($a_list) {
  $this->output('<div style="margin:20px 0; max-width:100%"/>
AD CODE HERE
</div>

');

  parent::a_list($a_list);
}
 

but code is displayed above related questions, but I need that the code would be displayed under a qustion.

Please help, give me correct code which will be displayed advertisement immediately below question.

 

by
So did the solution work for you?
by
Yes it is! Very big thanks!

2 Answers

+1 vote
by
edited by

If you want it immediately under the question then you shouldn't use the a_list function. That has control over the answer list so it makes sense that the result is the code after the answer list. Based on the fact that the theme you're using is not already overriding q_view then I'd advice you to override q_view_main by adding this code to your qa-theme.php file:

public function q_view_main($q_view)
{
      qa_html_theme_base::q_view_main($q_view);
      $this->output('Your ad code');
}
 
Hope that helps.

 

by
This works, thanks
0 votes
by
You can just modify qa-theme.php for that, download from below link...it should work with latest Q2A version.

http://prothoughts.com/q2a/
...