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

Hi guys,

For SEO, I would like to change => All titles add "- sitename" I want "| sitename"

A kind of slash to separate. It does matter for seo ;-)

Thanks to tell me where to change this?

by
+1same problem here, any answer?

1 Answer

+4 votes
by
selected by
 
Best answer

The quick and dirty way (tainting the core):

  1. Open qa-theme-base.php
  2. Look for this function:

function head_title()
{
    
$pagetitle strlen($this->request) ? strip_tags(@$this->content['title']) : '';
    
$headtitle = (strlen($pagetitle) ? ($pagetitle ' - ') : '') . $this->content['site_title'];
    
    
$this->output('<title>' $headtitle '</title>');
}

  1. Change the dash in there

The harder and cleaner way (not tainting the core, just a theme, but will depend on each theme):

  1. Open the qa-theme.php file for your current theme
  2. Look for a function with the same name
  3. If it exists
    1. Make sure you ouput in there the title without the dash (code will depend on each theme)
  4. If it does not exist
    1. Add it. Copy the same function from qa-theme-base.php
    2. Paste it in the qa-theme.php file
    3. Change the dash
by
I found it! Thanks Pupi!
...