Subversion 1.7 on Ubuntu 12.04

Ubuntu’s default packages ship Subversion 1.6 with the 12.04 distribution. This is annoying if you want to use the newer Subversion 1.7, without upgrading your OS, and especially if you’re dealing with newer working copies:

svn: The path '.' appears to be part of a Subversion 1.7 or greater
working copy. Please upgrade your Subversion client to use this
working copy.

Turns out there’s an official Subversion PPA on Launchpad, so for Ubuntu 12.04 all you have to do is add the following couple lines to your /etc/apt/sources.list file:

deb http://ppa.launchpad.net/svn/ppa/ubuntu precise main 
deb-src http://ppa.launchpad.net/svn/ppa/ubuntu precise main 

And upgrade Subversion to its latest version with apt-get:

sudo apt-get update
sudo apt-get install subversion

At this point you should be running the latest, and the greatest:

$ svn --version
svn, version 1.7.8 (r1419691)
   compiled Mar 23 2013, 23:38:40

Hope this helps!

The Great Firewall of Russia

It’s a shame that the Russian “consumer watchdog” Rospotrebnadzor, the Ministry of Justice, and the Federal Service for Supervision in the Sphere of Telecom, Information Technologies and Mass Communications (or Roskomnadzor) were “smart” enough to block access to over 20 million blogs hosted on WordPress.com because three of them contained suicide, drugs, and terrorism related content, which apparently has to be censored in Russia.

Looks like somebody’s building the Great Firewall of Russia. I hoped we were better than that. Oh well…

7 Tips for Better WordPress Theme Development

I gave this talk at WordCamp Norway 2013. It covers several tips and tricks that will make you a better theme developer.

You can follow the slides and the notes/transcript below. If you have any questions or comments, feel free to ping me here or on Twitter, I’m always happy to help :)

Continue reading

Understanding get_template_part

If you’re creating WordPress themes you surely came across the get_template_part function at one point or another. It’s one of those hidden gems inside of WordPress that don’t get the attention they deserve. Let’s change that.

The get_template_part function is essentially a PHP include or require, on steroids:

  • It already knows where your theme is located and it will look for the requested file in that theme’s directory
  • It doesn’t issue a warning or fatal out if the requested file does not exist
  • It can search for other suitable files, if the requested one is not found
  • It knows about child themes and parent themes

Long story short, the get_template_part function allows you to break your theme down into smaller templates (or template parts), which can be reused across your other templates.

Although get_template_part is similar to a PHP include or require, you should not use it to include things like your theme options code, sidebars registration, custom widgets, etc. The get_template_part function should only be used to get template parts.

Let’s start off with some basic examples.

Continue reading

Amazon Kindle Fire

Today I turned 24 and my wife got me a Kindle Fire — something I wanted for ages, primarily for reading, but turns out it’s a great tablet for work and play too.

Amazon Kindle Fire

The first thing I did was go to the Amazon App Store to install a couple of free apps, but got quite a disappointing message: your payment method contains a non-US billing address, please use a US credit card, which I don’t have.

Luckily PayPal has a list of dummy credit cards where I got my American Express, entered a random US billing address, removed all other credit cards and addresses on file, and soon had free apps running on my Kindle. Great, though this method will probably not work for paid apps or books, and you’ll need an actual US credit card, or an Amazon gift card.

Anyway, time to make a list of things I’ve always wanted to read. What a great birthday present!

Speaking at WordCamp Norway 2013

In 2011 I spoke at zero WordCamps. In 2012 I spoke only at WordCamp Sofia. One of my goals for 2013 is to speak at five different WordCamps, and it all starts as early as January with WordCamp Norway.

WordCamp Norway is January 26th in Oslo, and I’m really excited since I’ve never been anywhere near Norway. Flight tickets ready and hotel booked, the only thing remaining is the presentation. I’ll have a 25 minute slot and will probably be talking about tips and tricks to make you a better WordPress theme developer. If you’re not attending, you’ll most likely be able to catch all the talks on WordPress.tv after the event.

I haven’t made any specific plans about the other four WordCamps, so if you’re organizing one in your area this year, and have a slot for an extra speaker, don’t hesitate to ping me. Make sure you do that at least a month prior to the event, since I’ll have to apply for a visa and all those boring things.

Are you speaking at any events this year?

Update: slides and notes for 7 Tips for Better WordPress Theme Development.