»
S
I
D
E
B
A
R
«
How to add an image in the Ahimsa Theme header
Jul 1st, 2009 by ravi

One question that crops up in the comments or via email is how you might add an image (such as a logo) to the red header bar of the Ahimsa theme. This is a tricky issue, because how you accomplish this depends on what the function of the image is and how large it is. Perhaps you want the image to be a background image for the header, like is the case for many WordPress themes. Or perhaps the image is a small logo. The changes to be made to the header code vary correspondingly.

The header is implemented as a table (and yes I know, tables for layout are so pre-CSS[2]) consisting of one row with three cells/columns. The first column is the blog title, with a yellow (default skin) border to its right, the second column is the subtitle, and the third is the search box. The relevant code can be accessed using the Admin section of your blog via Appearance -> Editor (WP >= 2.7). Choose the Header (header.php) option in the right Templates section, to edit the template code for the header.

The code for the table (in Ahimsa 2.2) is reproduced below:

<td colspan='2' id='header'>
 
<table border=0 cellpadding=0 cellspacing=0>
<tr>
    <td id='title'><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></td>
    <td id='description'><?php bloginfo('description'); ?>>/td>
    <td id='search' valign='middle'> <?php include (TEMPLATEPATH . "/searchform.php"); ?> </td>
</tr>
</table>
 
</td>

The three elements within the table are the ones mentioned above. To add an image to this header table, you have to first upload the image to your blog. How to do that is beyond the scope of this note. I will assume that you uploaded the image to your-wp-install-root/wp-content/uploads/myimage.png.

Now let us consider some scenarios:

1. The image is a small logo you want placed to the left of the title

This can be achieved quite simply by editing the first table cell above (with id=’title’) and inserting an IMG tag pointing to your image:

 <td id='title'>
     <img alt='' title='' src="<?php echo get_option('home'); ?>/wp-content/uploads/myimage.png" />
     <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
</td>

This might result in some wrapping around of the title text that might need to be addressed (a simple if deprecated way to avoid wrapping is to add the NOWRAP attribute to the TD element). Also, you may need to add “align=” attributes to the IMG to get it to align to the top, bottom or middle of your title text.

2. The image is a background that you want to add to the header

In this case your easiest option may be to edit the Stylesheet (style.css) and add a background-image attribute to the CSS specification for the ‘header’ element. See this link for some help.

3. The image is a large image that you want to use to replace the title or both the title and the subtitle

In this case, if you want to only replace the title, then follow the instructions for #1 above, but replace the code that adds the title:

 <td id='title'>
     <a href="<?php echo get_option('home'); ?>/">
     <img border='0' alt='' title='' src="<?php echo get_option('home'); ?>/wp-content/uploads/myimage.png" />
     </a>
</td>

The above makes the image/logo clickable to return the viewer to the home page. When you do this, you may wish to remove the (yellow) line to the right: to do that, you will have to edit the Stylesheet (style.css) and remove the border-right attribute for the “#header #title” element. Alternatively, you could just remove the “id=’title’” part from the above.

If you want to replace both the title and the description, you can simply remove the next TD element:

    <td id='description'><?php bloginfo('description'); ?>>/td>

These instructions provide some details on how to add an image to your blog header. In the interest of brevity, and getting some sleep, I have not drilled down into greater detail, assuming that the above will give you enough hints to accomplish finer customisation. You are as always encouraged to contact me if you need further assistance.

Comment SNAFU
Jun 23rd, 2009 by ravi

Apologies to those of you who have been trying to add comments and were prompted to register (which in turn was turned off!).

I had never intended to turn on the registration requirement and I am still puzzled about when I mistakenly made that change.

I have changed the configuration and you should be able to add comments again without having to register or enter any private information.

Safari 4
Jun 8th, 2009 by ravi

Safari 4 is out of beta and was pushed out to Mac OS X users via Software Update today. Two things I noticed: the tabs on top are gone, which is unfortunate. Second, there is a clear indicator in the address bar for when the browser is loading a page, and interestingly, this seems to be used even for AJAX/XmlHTTPRequest transfers. That’s a nice feature.

Adding widgets to the WordPress sidebar
Apr 23rd, 2009 by ravi

A frequent question I am asked is how to add widgets (the boxes for “Tags”, “Categories”, “Calendar” and so on) in the sidebar. This is not an issue specific to the Ahimsa theme, but is a WordPress feature that is fully supported by Ahimsa. Below is a Blair Witch Project like ;-) video that shows you how you can add widgets to your sidebar through the WordPress admin section of your blog. I hope the video file format is viewable on your system. You may need to install QuickTime (free).

View Video

Aesthetics and UIs
Apr 21st, 2009 by ravi

Much impressed as I am by Google products and services, I have been left cold by their not merely spartan but aesthetically displeasing user interfaces. You may disagree with me on that, and you may be right (I have no background in either design or aesthetics!), but still find the below from A List Apart (via Daring Fireball) interesting:

Attractive things work better

Okay, so maybe perceptions are important to product design. But what about “real” usability concerns such as lower task completion times or fewer difficulties? Do attractive products actually work better? This idea was tested in a study conducted in 1995 (and then again in 1997). Donald Norman describes it in detail in his book Emotional Design.

Researchers in Japan setup two ATMs, “identical in function, the number of buttons, and how they worked.” The only difference was that one machine’s buttons and screens were arranged more attractively than the other. In both Japan and Israel (where this study was repeated) researchers observed that subjects encountered fewer difficulties with the more attractive machine. The attractive machine actually worked better.

So now we’re left with this question: why did the more attractive but otherwise identical ATM perform better?

Norman offers an explanation, citing evolutionary biology and what we know about how our brains work. Basically, when we are relaxed, our brains are more ?exible and more likely to find workarounds to difficult problems. In contrast, when we are frustrated and tense, our brains get a sort of tunnel vision where we only see the problem in front of us.

[From A List Apart: Articles: In Defense of Eye Candy]

Ahimsa for Wordpress: Version 2.2
Mar 30th, 2009 by ravi

Below is the download link for version 2.2 of the Ahimsa theme for WordPress.

Download Ahimsa 2.2 for WordPress
Ahimsa for Wordpress
Version 2.2

What’s new:

  • Fixes for IE6/7/8. No rounded corners on IE yet (and perhaps never), but lots of font changes, cleanup, IE specific style adjustments to make the theme render tolerably decent on IE.
  • Fixed various bugs in the theme including bad comments and reply box rendering (thanks to various Ahimsa for WP users for pointing this out).
  • Fixed JavaScript error(s) which were causing problems with IE in particular.
  • Fixed bug where sidebar did not extend the entire length of the page when collapsed and restored.
  • Fixed issue: pingbacks and trackbacks were not being displayed.
  • Very preliminary/alpha implementation of custom skins. Currently, using a very simple interface, you can add your own colour schemes to Ahimsa for WP. An upcoming blog post will provide details. A few words of caution: there is no way to edit a “skin” using the UI and this implementation might change in a future release.

Stay tuned to the blog for additional info on skins.

Safari 4 beta
Feb 28th, 2009 by ravi

Apple has had a Safari 4 Beta out for a few weeks now. Should you wish to try it out on your Mac, a word of warning: installing this version utterly messed up my Mail, in particular my IMAP accounts. I blew away all traces of the accounts and recreated them from scratch in Mail. That didn’t help, nor did any of various other cleanup operations. Uninstalling it made my problems disappear. It is possible this problem is specific to me (such a critical problem would have raised louder howls!) or I am misdiagnosing it (one is a browser and the other a mail client). So usual acronyms apply: YMMV, FWIW.

Safari 4

Some interesting new features in Safari 4:

  • Offline support (HTML5)
  • New JavaScript engine (Nitro)
  • Cover Flow for bookmarks and history
  • “Top Sites” — new tab options like Google’s Chrome
  • Tabs on top like Google Chrome (what where they thinking?!)
  • A JavaScript debugger and profiler

Available for Mac OS X and Windows, if you want to brave it!

UPDATE: The problem was incompatibilities between Safari 4 and one of my Mail Plugins (Proxifier), which I was not using anyway. I removed /Library/Mail/Bundles/Proxifier and all is well!

MacHeist 3
Feb 10th, 2009 by ravi

Head on over to MacHeist to grab some free software after you sign up as an “agent” and solve the assorted mysteries on offer (actually, from what I can tell, you don’t even really need to solve them?). Now available:

  • ShoveBox (a collection management system for storing bits of info, URLs, etc)
  • Webbla (a very slick looking URL manager)
Ahimsa featured on WordPress themes
Jan 18th, 2009 by ravi

I am not quite sure what it takes or means to get “Featured” at WordPress’ theme page, but FWIW Ahimsa is currently listed there. Download while its hot ;-).

Ahimsa Featured

Ahimsa for Wordpress: Version 2.1
Jan 13th, 2009 by ravi

Below is the download link for version 2.1 of the Ahimsa theme for WordPress.

Download Ahimsa 2.1 for WordPress
Ahimsa for Wordpress
Version 2.1

What’s new:

  • Support for WordPress 2.7’s new comment mechanism (including threading, paging, per comment replies).
  • Some changes to comments section, including:
    • Consistent use of title and action capsules.
    • Moved reply form to its own box.
  • New configuration options for/to:
    • Default display of sidebar in posts and pages.
    • Turn off the § prefix symbol for sidebar sections.
    • Turn off display of date/author for pages.
»  Substance: WordPress   »  Style: Ahren Ahimsa