All the features of Thesis 2 may entice users who are not flexible with writing code. But seasoned WordPress & Thesis developers may want to work with Thesis 2.0 the traditional way with:
- custom_functions.php, to flexibly add new functionality through code and
- custom.css, to use the goodness of text-editors — syntax highlighting, text-formatting, undo-redo, find & replace ability and the likes.
Here are three simple steps to make it possible for you to work with Thesis 2.0 in the traditional manner.
- Locate custom.php: The directory structure of Thesis 2.0 is slightly different from Thesis 1.8.5. Instead of a custom folder, here you will find separate folders for skins, boxes and packages. And every skin has a file called custom.php similar to custom_functions.php. You can find custom.php at this location: wp-contentthesisskins<active-skin>custom.php. If you want to add new functionality; i.e., manually code hooks and filters, you can edit the custom.php of the active skin.
- Create custom.css: Create a file called custom.css and place it right next to custom.php (ie in the same folder).
- Enqueue Custom Style-sheet:The last step is to enqueue custom.css. Add the following code to the custom.php of the active skin to enqueue the custom stylesheet named custom.css.
function enqueue_my_styles() { // Register the style: wp_register_style( 'custom-style', THESIS_USER_SKIN_URL . '/custom.css?ver=','',microtime(),'all'); //the microtime acts like a cache buster during the development. remove it when the site is live. // Enqueue the style: wp_enqueue_style('custom-style'); } add_action('wp_enqueue_scripts', 'enqueue_my_styles');
The code is commented and self-explainatory.
- The “Custom” body class: And while we are at it you may also want to use the
.custom
class in the custom.css. Here you go:add_filter('body_class','custom_class_name'); function custom_class_name($classes) { //add custom to the body classes $classes[] = 'custom'; // return the $classes array return $classes; }
Make sure that you have ‘Use automatically-generated WordPress body classes’ checked on in the Body box in the Thesis template.
Follow these three simple steps and you are all set to rock with Thesis 2.0 the traditional way!