BenV's notes

WordPress 3.0 update!

by on Jun.18, 2010, under Software

Since I was in another update mood I decided to take a quick look at my notes.
The admin page mentioned something about the new 3.0 version.
Obviously I immediately became very excited and ran to the bathroom.
After screaming for half an hour I made a backup of the wordpress dir and sql and wondered if the auto-upgrade button would work.
Always a surprise…. but it worked! It actually worked!

Suddenly the admin page looked slightly different (round corners in opera, that kind of rubbish), yet still exactly the same.
Oh well. They have a better updates overview now though. So I also decided to update the theme. Which restored a stupid
“swear at wordpress” box that I molested in the previous version. “Oh yeah, now I remember…”. (note that this is simply the theme
that has that stupid box there).

Wordpress 3.0 Pixel Theme v2.0.2 with stupid welcome box

Wordpress 3.0 Pixel Theme v2.0.2 with stupid welcome box

… when trying to insert an image here I found out that the new wordpress actually destroyed the image upload dialog.
Obviously it’s only broken in the Opera version I’m using, so it’s probably them… but still… *rage*…

In other words, a good time to try out what they call Child Themes.
If done correctly this supposedly prevents further updates to the theme from reintroducing this box. Unless they do something
silly of course, like adding a new box in a different template.
Here goes!

First we create a dir for the theme, it can be named whatever you like.
Then we create a style.css file.

benv@wordpress:~/public_html$ cd wp-content/themes/
benv@wordpress:~/public_html/wp-content/themes$ mkdir benv-pixel
benv@wordpress:~/public_html/wp-content/themes$ cd benv-pixel
benv@wordpress:~/public_html/wp-content/themes/benv-pixel$ vim style.css

The style file can be very empty, basically it imports the parent theme and optionally overrides things:

/*
Theme Name: BenV's Pixel Child Theme
Theme URI: http: //notes.benv.junerules.com/
Description: Child theme for the Pixel theme
Author: BenV
Author URI: http://notes.benv.junerules.com/
Template: pixel
Version: 1.0.0
*/

@import url("../pixel/style.css");


Make sure to correctly name the template (case sensitive) that you base the theme on, in our case pixel.

Well, so far so good, but this doesn’t actually change anything. What we want to get rid of is a stupid box that apparently is in the
welcome.php file of the pixel theme. In fact, welcome.php pretty much is the entire thing that annoys me.
So let’s create our own welcome.php file:



Easy huh?

Now you can go to the Admin panel -> themes and then you’ll see your child theme right there.

BenV's WordPress Pixel Child Theme

BenV's WordPress Pixel Child Theme


Activate it (or preview it first to be sure), and we’re done.

However, things never work as intended, so this fails. *sigh*. Nice try WordPress.
When we look into this matter, we notice that the pixel theme doesn’t really have a welcome.php template.
What it does have is a sidebar.php template, which includes the welcome.php from its own template path.
In order words: we can’t override welcome.php (until they fix the Pixel theme), but we have to override the sidebar.php file.

Here goes:

benv@wordpress:~/public_html/wp-content/themes/benv-pixel$ cp ../pixel/sidebar.php .
benv@wordpress:~/public_html/wp-content/themes/benv-pixel$ vim sidebar.php
# Remove lines 6-8, they look like this:
#

  • #
    #
  • :wq

    Yay! It works!




    :, , ,

    Leave a Reply

    You must be logged in to post a comment.

    Archives

    • 2016 (1)
    • 2015 (7)
    • 2014 (4)
    • 2013 (11)
    • 2012 (27)
    • 2011 (26)
    • 2010 (25)
    • 2009 (68)