Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
359 views
in Q2A Core by
How to display the complete questions on the questions page. As of now, it displaying only the title of the question. Is there any possibility to display the title and question, as it shows on the answer page

2 Answers

+1 vote
by

AFAICS the Q2A data structure for the question list contains only the titles, not the content of the questions. The code for displaying question list items already seems to have provisions for displaying question content along with the title, though, so you could probably override q_list_item() (or q_item_main()) in your theme to add the content to the item data structure:

$q_item['content'] = qa_db_read_one_value(
  qa_db_query_sub(
    'SELECT content FROM ^posts WHERE postid=$',
    $q_item['raw']['postid']
  )
);

However, including question content in the question list will automatically clutter the list, making it harder for people to browse. If you must do it (which I don't recommend), you should at least limit the length of question content displayed in the question list:

$content = qa_db_read_one_value(...);
$q_item['content'] = (strlen($content) > 150) ? substr($content, 0, 147) . '...' : $content;

0 votes
by
...