Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
2.5k views
in Q2A Core by
This is my new site I recently setup: http://codquestions.com

I would like to change the <title> </title> of the homepage which is set to Recent Questions and Answers.Currently the title is "COD Questions"

I'd like to change it to something like "COD Questions and Answers for Black Ops and MW3"

I don't want to change the title of the entire site, just the <title></title> tag for the homepage. How do I accomplish this? I believe it has to do with php but I'm really unfamiliar with it.
by
Did you fix this? It says "COD questions" on the homepage now.
by
Nope, I am still looking for a solution. I hope my question makes sense. I've searched for solutions here and the closest thing I could find is this person that wants to change the <title></title> of the Question page.

http://www.question2answer.org/qa/9548/how-to-change-title-of-question-pages

But I'm looking for a way to change the <title></title> in the Index Page or Home Page.

1 Answer

+1 vote
by

There are 2 things you can do:

1. Change the site name under Admin > General. However, this will change it for the entire site which you may or may not want. By which I mean, your long string "COD Questions and Answers for Black Ops and MW3" will appear at the end of every page title on the site.

2. Use an advanced theme (see docs). Override the head_title function with something like this:

function head_title()
{
    if ( $this->template == 'qa' )
        $this->content['title'] = 'COD Questions and Answers for Black Ops and MW3';
    parent::head_title();
}

Hope that helps!

by
Thank you so much DisgruntledGoat for answer my question. I really appreciate your help. Unfortunately, I tried putting the code you gave me into my advanced theme in qa-theme.php between the    

<?php

    class qa_html_theme extends qa_html_theme_base
    {

AND

    }

but it's not working :(. What am I doing wrong?
by
Hmm not sure, sorry. That should be working fine. Have you set the correct theme in Admin?
by
Yeah the theme is correct. I tried this code out on a fresh install of Q2A and it also didn't work.

However when I changed

if ( $this->template == 'qa' )

to

if ( $this->template == 'questions' )

It did change the title on the questions page. I think this means that 'qa' isn't the right one to change the title of the index (recent questions and answers) page. What do you think?
...