Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
915 views
in Q2A Core by
I wanna make my title like this without change site name <h1>site title - tagline</h1>
Q2A version: 1.81
by
Not so clear but if you want to make question title with the site tag line than just modify your title method by adding tag line in it.
by
im using this code,

function head_title()

{

$pagetitle=strlen($this->request) ? strip_tags(@$this->content['title']) : '';
$headtitle=(($this->template == 'qa') ? 'YOUR CUSTOM TITLE HERE' : (strlen($pagetitle) ? ($pagetitle.' - ') : '').$this->content['site_title']);
 
$this->output('<TITLE>'.$headtitle.'</TITLE>');
}

but, this code change the title of my category page . Any solution ?

2 Answers

0 votes
by
edited by

I try to cutomize this code .. But my tagline in first posititon.. Any idea to change my posititon tagline ?

public function head_title()

{

$pagetitle = strlen($this->request) ? strip_tags(@$this->content['title']) : '';

$headtitle = (strlen($pagetitle) ? "$pagetitle - " : 'TAGLINE TEXT - ') . $this->content['site_title'];

$this->output('<title>' . $headtitle . '</title>');

}

0 votes
by

If you want the site title first, switch around the variables. So the line would be like this:

$headtitle = $this->content['site_title'] . ' - ' . (strlen($pagetitle) ? $pagetitle : 'TAGLINE TEXT');

by
your code make the post titile like " site title - post title " I wanna change the position just on homepage . Any idea ?
by
In that case I think you’d need to wrap that code above in an if clause like this:

if ($this->request == '') {
  // code above
}
...