Skip to content

Instantly share code, notes, and snippets.

@richerimage
Created May 5, 2016 04:39
Show Gist options
  • Save richerimage/0e8ec30d72af59842bf94d592c730845 to your computer and use it in GitHub Desktop.
Save richerimage/0e8ec30d72af59842bf94d592c730845 to your computer and use it in GitHub Desktop.
Conditional php statement based upon active Thesis 2 template
/*
* Thesis API: new is_template() method can be used to determine which template is currently rendering on the front end
*
* Check which Thesis template is currently running.
* Note: This method uses the proper template name (such as "Landing Page")
* Props: Girlie
*
*/
public function is_template($name = '') {
global $thesis;
if (!empty($name) && !empty($thesis->skin->_template['title']) && $thesis->skin->_template['title'] === $name)
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment