thetuningspoon Posted July 30, 2012 Share Posted July 30, 2012 Hey guys, I'm trying to grab the name of the current template in order to apply it as a body class which I can use to tweak my CSS based on the template I have loaded. I'm using $page->template->name to achieve this. It works, except when I have the adminbar installed. If the adminbar is running, the template name is output as "adminbar-loaded" instead. Any way around this? Link to comment Share on other sites More sharing options...
diogo Posted July 30, 2012 Share Posted July 30, 2012 try $page->template instead of $page->template->name Link to comment Share on other sites More sharing options...
Soma Posted July 30, 2012 Share Posted July 30, 2012 https://github.com/apeisa/AdminBar/blob/master/AdminBar.js#L4 Link to comment Share on other sites More sharing options...
apeisa Posted July 30, 2012 Share Posted July 30, 2012 Is that somehow blocking the usual class or do you get both? I don't think it should "block". Link to comment Share on other sites More sharing options...
thetuningspoon Posted July 30, 2012 Author Share Posted July 30, 2012 Whoops, nevermind. It's including both classes now. This must have been an error on my part somehow. Thanks! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now