Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
641 views
in Q2A Core by

I want to put some PHP on the home page only. In my advanced theme, I have this code: 

if ($this->template=='/* what to put here? */')

{

//code

}

 

1 Answer

0 votes
by
 
Best answer

Right before your if, use the following to find out:

echo $this->template;

That will show you what's in the variable for any page.

by
Thank you. It echoes out custom. But I have several pages with the custom template, how do I differentiate between them?
by
In that case, check $this->request which gives you the URL fragment.
by
Great! Thanks.
...