public
Last active

Thesis Skin Starter Template - Basic

  • Download Gist
custom.css
CSS
1 2
/*---:[ body ]:---*/
body.custom { background: #000; }
custom_functions.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
// 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
}
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;
}
 
// below this line, use 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;

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.