Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

content of the question on the main page

+3 votes
asked Aug 15, 2016 in Q2A Core by emax9393

I read this topic : http://www.question2answer.org/qa/50582/show-question-content-on-the-main-page but I can not figure out what I need to insert into the qa-theme.php file

Q2A version: 1.7.4

2 Answers

+1 vote
answered Aug 15, 2016 by arjunsuresh

If you want to populate the question lists with question content (in addition to question title) you can use this plugin.


commented Aug 25, 2017 by esqeudero
the plugin needs some modifications. First, DESC appear in the same class (<div class="qa-q-item-title">). The content should be shown in its own class (<div class="q-content">)
+2 votes
answered Aug 25, 2017 by eserc

to separate TITLE and CONTENT div classes. Replace entire foreach code with below modified one in @arjunsuresh's plugin layer.php.

foreach ($q_list['qs'] as $index => $question) {

if (isset($postinfo[$question['raw']['postid']])) {

$thispost = $postinfo[$question['raw']['postid']];

$text = qa_viewer_text($thispost['content'], $thispost['format']);

$text = htmlspecialchars(preg_replace('/\s+/', ' ', $text));  // Remove duplicated blanks, new line characters, tabs, etc

//$text = qa_shorten_string_line($text, $maxlength);

if($this->template =='blogs')

$title =  $thispost['title'];

else $title = isset($question['title']) ? $question['title'] : '';

if(strlen($title) < $minlength){

$text = '<div class="q-content">'. qa_substr($text,0,$maxlength).'...</div>';

$q_list['qs'][$index]['title'] = $title;

$q_list['qs'][$index]['content'] = $text;





commented Mar 1 by Emre
Çok teşekkür ederim, çok işime yaradı :)