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

I want to make appear the answer/comment button on the question list page itself. Can anyone help me with this, please?

1 Answer

0 votes
by

You have to redesign the function q_list($q_list).

It's easier said than done because q_list function links to q_list_items function, which links to q_list_item function, which links to q_item_stats, q_item_main and q_item_clear functions. q_item_main function links view_count, q_item_title, q_item_content, post_avatar_meta, post_tags, q_item_buttons functions. And so on so forth because it doesn't stop there.

But you can edit any of those functions and insert your comment/answer links, especially when you use basic theme which display only question title on the question lists.

To show the answer and comment buttons, you can try adding this function

$this->q_view_buttons($q_view);

to one of those functions. I suggest you can try modifying like this:

public function q_list_item($q_item)
    {
        $this->output('<div class="qa-q-list-item' . rtrim(' ' . @$q_item['classes']) . '" ' . @$q_item['tags'] . '>');

        $this->q_item_stats($q_item);
        $this->q_item_main($q_item);

       $this->q_view_buttons($q_item);

        $this->q_item_clear();

        $this->output('</div> <!-- END qa-q-list-item -->', '');
    }
 

If it doesn't work, you need to manually create such buttons that may function as if they are real ones.

by
Thanks for the answer. it's not showing answer button, but it showing the share buttons, is there any other way to add the answer button?
by
Obviously, you must have been using another plugin that exploits the q_view_buttons function. I check and that's social share plugin.

But it may also mean that the default Q2A function for answer/comment buttons may not work on the question list.

You have to create your own function. Since I have no interest like you, I can't recommend anything. In my own Q2A installation, I create a fake button. If a user clicks on it, it will show the question page.
...