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


I wrote some code in my plugin with which the Moderators can choose a "Question of the Week".

I now want to show it on the Home Page, as the 1st Entry in the "Recent Questions", with some Highlighting. I can do that by overriding the functions in the Class qa_html_theme_base in my Custom Layer. For this, I need to add my question the q_list array. But when I analyzed the content of the array, it has a number of parameters in it, for every question to be displayed. I tried the method suggested in this post:

But the infomation fetched is significantly less than what the elements q_list of  have. Can anyone explain it to me, what's the best way to add a question in a custom way on the Home Page?

1 Answer

+1 vote
Off the top of my head, I don't think adding it to q_list is the way to go; better to just add a div before the q_list; at the beginning of the q_list function, retrieve a single question from the database and output it as you want it to be displayed.

If you really want it in the q_list, this seems to work:

        function q_list($q_list)
            $postid = <yourpostid>;
            require_once QA_INCLUDE_DIR.'qa-db-selects.php';
            global $qa_login_userid, $qa_cookieid, $qa_request;



            $post = qa_any_to_q_html_fields($post, $qa_login_userid, $qa_cookieid, $usershtml, null, $options);
            array_unshift($q_list['qs'], $post);