Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
in Themes by
I was creating a theme so needed to override the q_list function. The raw data contains the question ID but obviously, I need to process a request to get all answers to the question. Is there any available method in the qa-theme-base.php file (or in any other file ) that can handle the request or do I need to run a custom MySQL query?
Q2A version: 1.8.6

1 Answer

0 votes
edited by

I don't think there's a function to get all answers to a question, but the database query for fetching the IDs of all answers to a given question is pretty simple:

qa_db_query_sub('SELECT postid FROM ^posts WHERE type="A" AND parentid=#', $id);

where $id is the post ID of your question.