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

Hello

I would like to set name of my page as for example "My Q2A page". In this situation, how to make an individual meta title of main page, for example "My Q2A page - questions, answers and even more"?

Please note, that on question pages I would like meta title to be like "Question title - My Q2A page".

Just to mention - having an individual, longer meta title of main page is important when we talk about SEO of our website.

Q2A version: 1.8.5.

2 Answers

+1 vote
by
selected by
 
Best answer

public function head_title() {

    if (qa_request() === '') {

        $firstPart = $this->content['site_title'];

        $secondPart = ' questions, answers and even more';

    } else {

        $firstPart = strip_tags(@$this->content['title']);

        $secondPart = $this->content['site_title'];

    }

    $this->output(sprintf('<title>%s - %s</title>', $firstPart, $secondPart));

}

1- You can add this code  on qa-theme/themename/qa-theme.php before last  

2- In Administration CENTER General , write your this My Q2A page  in Q&A site name:

You will get result that you want.

by
there are many posts you can find about your questions like this one
https://www.question2answer.org/qa/72152/how-can-i-change-the-index-homepage-page-title-only
by
Thank you for this solution! It works great.
+1 vote
by

In Administration center > Layout you can set a meta description for the homepage.

Meta description and page title are entirely different things, though, so I'm not quite sure if that's what you were asking, or if you want to set a different page title just for the homepage. I don't think there's a configuration option for the latter, so you'd probably have to write a plugin.

by
I was asking about different page title of homepage.
by
Like I said, you'll probably have to write a plugin for that. And before you ask: no, I'm not going to write it for you.
...