WordPress theme Tarski hacks

For a very short while, I forayed into TextPattern and wanted it to replace WordPress. It turned out that WordPress is just too convenient and powerful to be replaced. But I am still very impressed by Textile formating syntax embedded in TextPattern.

My adventure (as I have promised) into TXP does give me one benefit. I came across a ported theme for Tarski from WordPress and I love it.

Here are a few things I learnt about tweaking Tarski — all dug from its forum and documentation.

Using alternate styles

To overriding the default style, one just need to select an alternate style in Tarski’s option page. And in the new style, input the new syntax and attach the new theme to the body classes.

This is what I use to change the color of the wrapper for my own style:

body.thinkweird #wrapper { background: #fff; }

Align the sidebar with the post

By default, the sidebar bottom border does not line up with its counterpart under the post title. One has to manually the sidebar a little to achieve that.

body.thinkweird #sidebar {padding-top: 1.06em; background-color: #fafafa;}

The color of the background can also be changed by adding background-color: #fafafa;

Make the post navigation bar span

How to force the post navigation that appears on single post pages to span the entire length of the header?

body .thinkweird.articlenav {padding-left:0; text-align:center;}
body.thinkweird.janus .articlenav {padding-right:0;text-align:center;}

text-align:center; in the second line is especially important. If the sidebar is moved to the right, the value in that piece of code should be either center or left

Adding Google Ads

One thing about Tarksi is that its developer makes simple and effective plugins for the theme. Users are spared the hassle to manually modify theme files. Here is the plugin to insert Adsense to the post.

Two things to keep in mind to insert ads to other places.

  1. Theme hooks. For example, if I want to place ads on the on top of the navigation bar, I just use th_navbar hook. It is a gold mine worthy to dig into.
  2. Rename the function. Obviously, to insert ads into the navigation bar, I can create another plugin and change the function into tarski_output_adsense_bottom or something else unique.

I am a happy users of Tarki now.

Leave a Reply

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