A Blank WordPress Theme

I’ve just uploaded a blank WordPress theme called Naked that I built to assist those (like myself in the past) who have a need to quickly roll-out a WordPress theme with a custom look and feel but may not necessarily have the time to start from scratch.
It is purposely very simple and basic, but I’ve put some effort into making it self explanatory and for anyone with experience of PHP/XHTML/CSS it should be an absolute doddle to use.

Here’s the default look, woo!

screenshot.png

You can download it here, enjoy.

WordPress spam plugin

After getting over 200 comment spams in 2 days I decided to implement an automatic spam blacklist system as manual parsing wasn’t cutting it any more.

Akismet seems good:

We can’t stand spam.

Who can? You have better things to do with your life than deal with the underbelly of the internet. Automattic Kismet (Akismet for short) is a collaborative effort to make comment and trackback spam a non-issue and restore innocence to blogging, so you never have to worry about spam again.

http://akismet.com/

WordPress Widgets

I’m a developer, I don’t mind – in fact, no, I *like* – coding but when it comes to doing stuff on my own site I’m rather hesitant and I prefer things that Just Work out of the box.

I installed a new theme K2 last night and whilst it looks good I did have to tinker with a few files, mostly sidebar.php to get things how I liked them and it left feeling ever-so-slightly that it’d be better if layout control was dealt with using the admin GUI rather than code.

This morning I found this on the WP dev site:
http://wordpress.org/development/2006/03/widgets-plugin/

Widgets are an easy way for you to arrange and rearrange your sidebar to your hearts content without touching a line of code. We first launched WordPress Widgets (WPW) it on WordPress.com a month ago and the response was great. Now we’re ready to release the plugin to the world. If adoption goes well, we’ll consider rolling it into the next version of WordPress.

You can find out more information and download the plugin on the new Widgets page.

That was enough for me. I downloaded it, unpacked to wp-content/plugins and then went to the admin area and enabled it. Now under Presentation I have a Sidebar Widgets option where I can drag and drop the out-of-the-box widgets onto the sidebar.

Even better, each WP theme needs minimal code alteration to enable Widgets (a few lines) but K2 already had the hooks built in so I didn’t need to do anything else!

Related:
Download WordPress Widgets
K2 WordPress theme

WordPress PHP syntax highlighting

I’ve been writing code in my spare time again and have been wanting to blog little snippets but WordPress munges any code that I add into the post body. I googled for wordpress plugins and most didn’t support WP 2 or were a bit tame but then look what I found.

The iG:Syntax Hiliter by Amit Gupta. Just download, extract, upload to your wp-content/plugins folder, enable within the admin screen and Bob’s your mum’s brother.

Let’s try it out:

[php]$animals = array( “cow” => “moo”, “sheep” => “baa”, “dog” => “woof”);

foreach ($animals as $animal => $noise)
{
print “I am a ” . $animal . ” and I make a ” . $noise . ” noisen”;
}[/php]

[mysql]

CREATE TABLE `Instance` (
`ID` int(11) NOT NULL auto_increment,
`Site` varchar(255) NOT NULL default ”,
`App` varchar(255) NOT NULL default ”,
`Passwd` varchar(32) default NULL,
`Expires` int(11) default NULL,
`Archive` tinyint(1) default NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `instance_site_app_uniq` (`Site`,`App`)
) TYPE=InnoDB;[/mysql]

[css]body {
margin: 0;
padding: 0;
font-size: 68%; /* Resets 1em to 10px */
font-family: ‘Lucida Grande’, Verdana, Arial, Sans-Serif;
background-color: #CCC;
color: #333;
}

#page {
background-color: white;
border: 1px solid #959596;
margin: 20px auto;
padding: 0;
}

[/css]

[html]


[/html]

[perl]#!/usr/bin/perl -w

use strict;

my $dumpDir = “/export/backup”;
my $mysqlBin = “/usr/bin”;
my $mysqlPassword = “foo”;

foreach (`ls -F /usr/local/mysql/var`)
{
if (///)
{
chomp;
s//$//; # remove the trailing / now
my $dumpFile = “$dumpDir/$_.sql”;
my $dumpCommand = “$mysqlBin/mysqldump -celqF –password=$mysqlPassword $_ > $dumpFile”;
system $dumpCommand; # or warn “mysqlDump of $_ failed”;
}
}[/perl]

As a nice value-add (like it needed to do any more) he’s also included the relevant code to add buttons to the content addition textarea (assuming you’ve disabled the dynamic one) so it surrounds your code with the relevant markers.

What a great plug-in.

Related: