Tabula Rasa » Wordpress
home mail us syndication

Archive for Wordpress

Fucked up explorer

I hate microsoft.

here is the fucked up files:

style

header

Playing with wordpress - Hacking the header to display random pictures

After I started seriously playing with wordpress and discovered how cool it is, I decided that I can seriously hack to it my own needs. I looked and many many themes and found this theme called amazing grace. It has lots of cool features, but I find its overall look a bit overwhelming and childish. My heart goes into simple themes like andreas. But I decided to borrow the random header image from amazing grace. This random image effect can be achieved with plugins like nextgen gallery, but in order to keep it simple I borrowed one line of code from amazing grace. So in this short tutorial I’ll show how to do it with wp-andreas theme.

Andreas theme comes with 15 different header images. In order to change between them randomly we first have to rename them all in the following scheme fornt0.jpg, front1.jpg front2.jpg and so on.

Next we open the file header.php with a text editor, or the theme editor from within wordpress, and we change the following line:
<img id="frontphoto" src="<?php bloginfo('template_directory'); ?>/img/front.jpg" width="760" height="175" alt="" />
to:
<img id="frontphoto" src="<?php bloginfo('template_directory'); ?>/img/front<?php echo (rand()%14); ?>.jpg" width="760" height="175" alt="" />
next we save the file, and that’s it. We’re done!

Now hit the refresh button on your main page of your blog and see how the header image changes with every refresh we do.

WordPress rant…or may be rants…

WordPress is a great tool for quickly building a personal blog, website or even a store or a large community website. However, there comes a time with every wordpress installation, or maybe even every pre built content management system such as Drupal or Joomla!, that you encounter the glass ceiling where you have to start heavily digging in code you didn’t write.

I started with Drupal 4.7 almost two years ago. I built www.cyclejerusalem.org in a couple of days. But when I started reaching a higher degree of complexity I stoped using Drupal and moved to Wordpress because it was easier to handle. This week I finished building the new website of www.cyclejerusalem.org using wordpress.

This is a list of stuff I am not happy with, which can be read as a bug report if you wish.

Read the rest of this entry »