Created
March 15, 2012 18:30
-
-
Save chasereeves/2045873 to your computer and use it in GitHub Desktop.
Thesis CSS stripping within skin (custom_functions.php)
This file contains hidden or 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
| <?php | |
| // deny direct access | |
| if (! defined('ABSPATH')) | |
| die('Please do not directly access this file'); | |
| class thesis_skin_example extends thesis_custom_loop { | |
| public function __construct() { | |
| parent::__construct(); // this "activates" the Custom Loop API | |
| add_action('init', array($this, 'init')); | |
| } | |
| public function init() { | |
| $this->actions(); | |
| $this->filters(); | |
| $this->switch_skin(); | |
| } | |
| public function actions() { | |
| // add and remove actions here | |
| } | |
| public function filters() { | |
| // add and remove filters here | |
| add_filter('thesis_css', array($this, 'css'), 11, 4); | |
| } | |
| private function switch_skin() { | |
| // Since after_switch_theme won't run, let's make sure that we generate the CSS | |
| if (is_admin() && ! get_option(__CLASS__ . '_generate')) { | |
| thesis_generate_css(); | |
| update_option(__CLASS__ . '_generate', 1); | |
| wp_cache_flush(); // flush the cache so things don't break! | |
| } | |
| else return null; | |
| } | |
| public function css($contents, $thesis_css, $style, $multisite) { | |
| // put in nothing | |
| $css = ''; | |
| // return it | |
| return $css; | |
| } | |
| // Methods from the Custom Loop API. | |
| public function home() { | |
| thesis_loop::home(); // remove this line and put your own home loop here | |
| } | |
| public function archive() { | |
| thesis_loop::archive(); // remove this line and put your own archive loop here | |
| } | |
| } | |
| new thesis_skin_example; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment