Update 2011-09-18: This post is out of date. See the latest release here.
I’ve been maintaining my own hacked-up theme based on Tarski for several years now. This required modifying the theme source, which meant that every update to Tarski would overwrite my customisations. The better way to do this is to write a child theme.
Behold Tolarski, a Tarski child theme for variable width. Tolarski isn’t intended for general release, and I don’t intend to support it for external use. However, I regularly get questions from people wanting to know how I did it, so I’m making the code available.
The details are similar to my previous blog post. The variable-width columns are implemented in CSS, and the header images are positioned in CSS and implemented by a new function which modifies th_header
. Tolarski ignores the WordPress “header image” setting.
From functions.php:
function tolarski_headerimage() { $header_img_url_base = get_bloginfo('stylesheet_directory') . '/headers/'; echo " <div id=\"header-image\"> <img alt=\"Header image\" src=\"".$header_img_url_base."/tolaris_level1_black.png\" id=\"header_image_blackbg\" /> <img alt=\"Header image\" src=\"".$header_img_url_base."/tolaris_level2_blue.png\" id=\"header_image_bluebg\" /> <img alt=\"Header image\" src=\"".$header_img_url_base."/tolaris_level3_gradient.png\" id=\"header_image_gradient\" /> <img alt=\"Header image\" src=\"".$header_img_url_base."/tolaris_level4_cmda.png\" id=\"header_image_cmd\" /> <img alt=\"Header image\" src=\"".$header_img_url_base."/tolaris_level5_sat.png\" id=\"header_image_satellite\" /> <img alt=\"Header image\" src=\"".$header_img_url_base."/tolaris_level6_science.png\" id=\"header_image_engineer\" /> <img alt=\"Header image\" src=\"".$header_img_url_base."/tolaris_level7_tolaris.png\" id=\"header_image_tolaris\" /> </div>\n\n"; } function init_tolarski_header() { remove_all_actions('th_header'); add_action('th_header', 'tolarski_headerimage'); add_action('th_header', 'tarski_titleandtag'); add_action('th_header', 'navbar_wrapper'); add_action('th_header', 'tarski_next_prev_posts'); } add_action('init', 'init_tolarski_header');
To use Tolarski, you’re going to have to modify tolarski_headerimage()
. This specifies the 7 header images by filename, which should be placed in tolarski/headers/. Please don’t use my images on your live blog, but if you just want to play with the theme you can find links in the page source.
Tags: wordpress
-
Hi, Tyler!
Thanks for child theme – tolarski. I have ine question. How to made title and site slogan like here?
I tried so many times, but not successful.-
Hi Tyler
I’m just getting into WP, & after a huge amount of googling, I decided to go with Tarski, intending on changing the width myself, with my very limited css knowledge. Then, I stumbled on your post above & heard about Tolarski, which is PRECISELY what I need.
The problem is, I can’t download the tar.gz file – I click on it, but I just get a 2k placeholder.
Can you help me out? I’m rip-roaring to go!
Thanks in advance,
Claire
Cape Town
-
4 comments
Comments feed for this article
Trackback link: https://www.tolaris.com/2011/05/23/tolarski-a-tarski-child-theme-for-variable-width/trackback/