Created
May 5, 2016 04:39
-
-
Save richerimage/0e8ec30d72af59842bf94d592c730845 to your computer and use it in GitHub Desktop.
Conditional php statement based upon active Thesis 2 template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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