Skip to content

Instantly share code, notes, and snippets.

@chasereeves
Created March 15, 2012 17:46
Show Gist options
  • Select an option

  • Save chasereeves/2045571 to your computer and use it in GitHub Desktop.

Select an option

Save chasereeves/2045571 to your computer and use it in GitHub Desktop.
Thesis child theme CSS stripping all but child theme
<?php
// Initial sanity check
if (! defined('ABSPATH'))
die('Please do not directly access this file');
// Bring in the main functions file so we have access to all the yummy Thesis goodness
include_once(TEMPLATEPATH . '/functions.php');
class thesis_responsive_child_theme extends thesis_custom_loop {
public function __construct() {
parent::__construct();
add_action('init', array($this, 'init'));
}
public function init() {
// actions and filters that will run on init. you could put other things here if you need.
$this->actions();
$this->filters();
}
public function actions() {
// this will force thesis to generate CSS when the user switches to the child
add_action('after_switch_theme', 'thesis_generate_css');
}
public function filters() {
// Filter out the standard thesis style.css.
add_filter('thesis_css', array($this, 'css'), 11, 5);
}
public function css($contents, $thesis_css, $style, $multisite, $child) {
// only include the child theme css
$css = $child;
// return it
return $css;
}
}
new thesis_responsive_child_theme;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment