Tolarski, a Tarski child theme for variable width

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:

  1. Vladimir’s avatar

    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.

    Reply

    1. Tyler Wagner’s avatar

      Vladimir,

      If you’re asking how to make the text appear hovering over the image, that’s done with CSS.

      Reply

    2. Claire Walker’s avatar

      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

      Reply

      1. Tyler Wagner’s avatar

        Hi Claire,

        I don’t know what you mean by “2k placeholder”. I can download it from my browser. If you run Mac or Linux, or have Cygwin on Windows, use:

        wget http://www.tolaris.com/blog/wp-content/uploads/2011/05/tolarski_theme.tar.gz

        Or try passing that URL to some download manager.

        However, you got me thinking about a few problems. The theme on this post is too old to work with recent releases, and you cannot install a tar.gz theme with the WordPress GUI. See my updated theme, now available as a ZIP file. See my recent post.

        Reply

Reply to Claire Walker Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.