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

I just want to index my website Homepage and Question & Answers Only. Please guide me how to write code for homepage like this :

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

$this->output('<meta name="robots" content="index, follow"/>');

Q2A version: 1.8.5

1 Answer

0 votes
by

Override the method head_metas() in your theme, e.g. like this:

function head_metas() {
  qa_html_theme_base::head_metas(); // invoke method from parent class
  if ($this->template=='question') {
    $this->output('<meta name="robots" content="index, follow"/>');
  }
}

...