Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
817 views
in Plugins by
it would be great if we could add the question tag to the Question Page Title. In my case i only allow one tag per question, and this tag should appear in the title. Any idea?

1 Answer

+3 votes
by

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

2. Add or merge the initialize() function like this:

public function initialize() {
    if ($this->template === 'question') {
        if (!empty($this->content['q_view']['raw']['tags'])) {
            $this->content['site_title'] .= ' | ' . $this->content['q_view']['raw']['tags'];
        }
    }
}

Result:

In the screenshot above how-to is the tag of the question

 

by
edited by
worked like a charm! just added it to the qa-theme.php and worked perfectly!
But one more thing:
now i have "question title" "site title" and "tag" as last one.
is it possible to leave the site title away or put it to the end?

many thanks so far!
...