Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Q2A Core by
In conversation i want to highlight the send and received message items with different background color. For this i need to add an extra class name on send or received items.

If there is any way, please tell me.
Q2A version: Latest

1 Answer

+2 votes
selected by
Best answer

Override this function in your theme:

        public function message_item($message)
        if (qa_get_logged_in_userid() == $message['raw']['fromuserid']) {
        $this->output('<div class="qa-message-item home-message" ' . @$message['tags'] . '>');
        else {
        $this->output('<div class="qa-message-item away-message" ' . @$message['tags'] . '>');   
        $this->post_avatar_meta($message, 'qa-message');
        $this->output('</div> <!-- END qa-message-item -->', '');

Many many thanks for your answer.  This is the right condition that I need