Skip to content

Instantly share code, notes, and snippets.

@palimadra
Forked from mattonomics/functions.php
Created March 27, 2012 13:05
Show Gist options
  • Save palimadra/2215603 to your computer and use it in GitHub Desktop.
Save palimadra/2215603 to your computer and use it in GitHub Desktop.
Thesis Child Theme - Basic
<?php
// Iinitial 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');
// we encourage you to set up a class. classes are a VERY important part of 2.0, so you need to be familiar with them.
class thesis_child_theme_example extends thesis_custom_loop {
public function __construct() {
// run the parent constructor so we can access the thesis custom loop api
parent::__construct();
// run the main init
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() {
// add and remove actions here
// 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() {
// add and remove filters here
}
public function home() {
thesis_loop::home(); // remove this line and enter your custom loop
}
public function archive() {
thesis_loop::archive(); // remove this line and enter your custom loop
}
}
new thesis_child_theme_example;
/*
Theme Name: Thesis Theme Example Child
Theme URI: http://diythemes.com/plans/
Description: Child theme for the Thesis
Author: DIYthemes - Matt Gross
Author URI: http://diythemes.com
Template: thesis_184
Version: 1.0
*/
/*---:[ body ]:---*/
body { background: #000; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment