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

We have been developing a new topic, and we need to modify the way the content of the questions is displayed, for example, remove "anonymous" when the question was asked by an anonymous.

Just remove "by anonymous"

Q2A version: I just need remove "by anonymous" after the question.
by
Hi.Which theme you are using?

1 Answer

+3 votes
by
selected by
 
Best answer

How can I change the way I display the questions?

Refer to the layers or to the theme documentation.

We have been developing a new topic, and we need to modify the way the content of the questions is displayed

There isn't such as thing as a "topic" in Q2A so it is very unclear what you've done so far and you haven't provided any detail so I guess it doesn't matter at all.

Q2A version: I just need remove "by anonymous" after the question

The idea of the "Q2A version" field is to provide the version of Q2A you're using. Answers may be different depending on your version. I'm assuming v1.7.x.

Anyway, in order to remove the "by anonymous" after the question you need to follow these steps:

1. Edit file qa-theme/<your-theme>/qa-theme.php

2. Add (or merge, if it already exists) this function:

public function post_meta_who($post, $class) {
    if ($post['raw']['basetype'] === 'Q' && isset($post['who']) && !isset($post['raw']['userid']))
        unset($post['who']);
    parent::post_meta_who($post, $class);
}

Output should look like this:

...