Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by
How do I go about changing the title for the index/homepage only?


For the example the website will be called "Test Website"

Homepage Title:

"Test Website - This is the best website come check us out!"

and for all the other pages it should just be:

"whatever - Test Website"

I'm using the Donut theme.

Q2A version: 1.8.3

2 Answers

+3 votes
selected by
Best answer

1. Edit file qa-theme/Donut-theme/qa-donut-layer.php

2. Add this function to the class:

public function head_title() {
    if (qa_request() === '') {
        $firstPart = $this->content['site_title'];
        $secondPart = 'This is the best website come check us out!';
    } else {
        $firstPart = strip_tags(@$this->content['title']);
        $secondPart = $this->content['site_title'];
    $this->output(sprintf('<title>%s - %s</title>', $firstPart, $secondPart));
Thanks it worked!
0 votes
ago by
Hello..?? Please help me..!!! Where will I put the code in qa-donut-layer.php?

I use donut theme.. But where will I put the theme? i did not understand what is class.. Please specify where I will put the code...

Thanks in advance...!