George Pearce - iamPearce

Icon

Homepage of 18 year old internet nerd, George Pearce.

No More Thesis

In the past week; a ‘debate’ has been raging between WordPress (chiefly @photomatt) and the developer of the well known Thesis theme, Chris Pearson (@pearsonified), about whether the Thesis theme, being a derivative of WordPress, must follow the same GPL-2 licensing. Legally, because Thesis contains code from WordPress itself (and runs as part of WordPress) the WordPress people say it should be, and I agree.

However, Chris Pearson believes himself exempt from these licenses, and refuses to license the theme under GPL-2 (which would make it open source) – presumably for income protection reasons (although several other premium theme producers have gone GPL and not looked back).

For this reason, I’m taking the Thesis theme (that I bought) down from my blog, and for the time being I will use the Twenty-Ten theme – until I sufficiently develop the new design I’ve been planning anyway. My understanding of or involvement in GPL is very limited indeed, but having read some choice quotes from a conversation between Chris Pearson and Matt Mullenweg, I was astounded by the arrogance of Pearson, and the argument presented by the WordPress team is sound. Thus, he has lost my support.

As it is, I love the Twenty-Ten theme, and if I didn’t want to have my own custom layout and design, I might have stuck with it.

WordPress 3.0 Custom Post Types

One of my favourite features of the upcoming WordPress 3.0 (so far) is the custom post types functionality, which means I can create a whole new post type, with a whole new permalink structure (and single post design / archive) to my main set of posts.

I’ve spent a little of the last couple of days reading around online, and having a little play- I’m going to write a proper post about it on BlogPremiere at some point in the next week or so, before the official launch sometime at the start of May.

I’d like to go through how anyone can use a custom post type on their blog, and how easy they are to get setup – because they really are and they could add an extra dimension to a WordPress site (as well as making a multi-user site far easier to manage).

I’ve added a new post type on iamPearce called photos, I’m going to see how that works out, and then extend it for use on BlogPremiere – I have a couple of ideas for new features that could be separate from the main blog, and beneficial to the site users.

I’ve yet to work out how to enable categories in the custom post types, but I’ve got tags – I love the challenge of learning new stuff about what I consider myself an expert at :)

Expect a post on BlogPremiere sometime in the next couple of weeks!

WordPress Stickers

Thanks to my good friend Neil, who very kindly mailed me a few, I have some WordPress stickers that I don’t need; and in the interests of spreading the love, and as I don’t have many local friends who even know what WordPress is, anyone whose in the UK who’d like one can drop a comment here and leave me their email, and I’ll see about mailing them.

I do only have ten, three blue and seven white, the others I received have been used =P

So anyone whose interested; I’m quite happy to post them anywhere in the UK for free, just don’t forget to thank @okneil as they orignally came from him :)

A Brand New Plugin

I’m in the process of finishing a new WordPress plugin up for release, one that I did for a client and then decided to redo slightly differently for the general public.

It’s going to enable the injecting of ads into the middle of posts, but unlike others that have been released, you can input any code you like, not just adsense or YPN, which the ones I have seen are limited too. I’m still working on the little things, but I will append this with a link to the first beta of it, so I can get a little feedback.

Once it’s ready, I’ll release it onto the WordPress Plugins site.

A Quickpress

This is just an aside that I wrote without even going to the write page. The new 2.7wp has a quickpress on the homepage, so, naturally, I’m trying it out.

Changing your WordPress Admin Username

Changing your WordPress username to something other than admin is reportedly a good way to help stave off brute force or dictionary attacks, where the hacker already knows your username and is only trying for your password.

It can be done by opening up PHPmyAdmin, going to the users table, and locating the user_login column. If you change that, your wordpress username will change.

Note – you should backup your database before attempting this, just in case. Do not attempt this unless you are confident that you know what you are doing – if in doubt, get someone to do it for you.

WordPress 2.6 Beta 1

Yesterday, Ryan Boren announced WordPress 2.6 beta 1. I’ve just upgraded to it. Among the cool new features are post revision tracking, which I’ve talked about before, and Google Gears support, which is very cool. I think I wrote about that before too.

There is also better support for SSL for the admin area, and bulk plugin management, as well as a bunch of other stuff (you have to read the post to see it all).

It doesn’t look any different to 2.5 (no surprises there) but there are some nifty little new functions, like the theme selector – when you click a theme it previews, like on wp.com, which is definitely cool.

I’m looking forward to the final 2.6.

Akismet Count Plugin Updates

I’ve become aware of a bug with my Akismet count plugin, which isn’t obvious to most people, but for those who have only recently installed, it breaks, and causes a PHP error if they have no spam caught. This is because Akismet only creates the spam reference that my plugin looks for when it nukes it’s first bit of spam.

For that reason, I’m going to put another line into the plugin, and release version 1.10, at some point in the next week, I hope. I’m also looking at making the actual text customisable, and making it similar and all that. Feedback would be appreciated on this, because with enough work I could make a version that integrates itself directly into your footer, without you having to do anything at all – I might release a branch of the current plugin to do that.

As always, any suggestions would be appreciated.

Charging $200-300 for a WordPress install?

I’ve been meaning to write about this for a while, a few weeks ago I stumbled on a website offering a WordPress install, with nothing special added on (no theme, not even basic setup) for $200-300. I was disgusted, and posted about it on a blogging forum I happened to be on.

I think that $200-300 is more than 10x too much to pay for something like that, and if the site mentioned doesn’t even have it’s own permalinks sorted out, what are the chances they’d do yours for you? I used to charge $5-10 for full WordPress installations, and i tend to help people out for free now – why charge $200-300? As it is, people who contact me generally tend to get my help installing stuff like that for free.

I actually wonder how many naive / unknowing people buy that service from other people for stupid money per month? It’s probably a fair few.

Additionally, those who are making blogs for non-commerical reasons can request the guys over at install4free to help them, free of charge once again.

I don’t think anyone should ever pay more than $20 for a WordPress install, unless it includes a custom theme.

Simple Asides

I’ve seen a number of tutorials about asides online, and I think that Ma.tt’s was the first. Thing is, it seems that it’s a bit complicated for some people, those who aren’t as amazing with PHP as him. Like me, then.

All of the tutorials I read included adding multiple chunks of code, left right and centre. I’m going to show you a nice simple way of adding asides to your blog, with only one chunk of code, and one “}”. That’s it. 2 inserts, and you’ll be ready to go :) I’ll also demonstrate some cool additions that you could do, if you like. I’d like to note that I learned this entirely by reading the previously linked post by Matt, and a few others all over the place, and by trial and error. I’ve lost count of how many times I’ve changed the asides structure on this blog, and I think I’ve sussed it now :)

Okay, before we start. You need a category, let’s call it asides. When you make it, hover over the edit link on the categories page, it should give you an ID number. It’s important that you remember that!

Please note – the following is code editing. If you’re not confident doing this, don’t. Get someone (like me) to do it for you, cheaply. Honestly though, it’s really simple. Always backup all of the files that you edit, it’s VERY important that you do so.

Right then. Open up your index.php file. This should be what is used to make the home page of your website show your posts. Ok, edit time. Look for the following line of code:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

That’s where WordPress starts processing your posts. Now, directly below that (before ANYTHING else) put the following:

<?php if (in_category(449) && !$single) { ?>
<ul>
<li id="p<?php the_ID(); ?>"><?php echo wptexturize($post->post_content); echo ' '; comments_popup_link('(0)', '(1)', '(%)')?> <?php edit_post_link('(e)'); ?></li></ul><br />
<?php } else { ?>

Replace 449 in the first line with the category number I told you to get earlier.

Now, last bit. Scroll down that file a bit more, until you find

<?php endwhile; else: ?>

and replace it with

<?php } endwhile; else: ?>

Save the file and reupload it onto your server. And you’re done. Now your asides will look like they do on this blog, without the vertical line on the left. That’s the basics out of the way. Now, I’ll look at some more complex modifications you can do if you want to, but you don’t need them to make asides work.

Something on the left?

You might notice that my blog has a vertical line on the left hand side of each aside? It’s very simple to add this to your own blog, follow the steps above, and then do the following:

Open up your style.css, and scroll right to the bottom. Ensure you’re not inside the { } of another property, there should be a } on the same line that you are, or at least close. Select the end of the last line, and hit enter. Then paste the following code in:


.asides {
border-left:4px solid #D8471D;

}

Then save. This example shows a pretty red border of 4px on the left hand side.

Now, back to index.php, and to the template I told you to paste in earlier. All you’ve got to do here is replace

<ul>

with

<ul class="asides>

And it’ll work. Nice and simple (again).

#D8471D in the CSS can be changed to any hex code you like.

Changing The Look A Bit

If you want to make the asides template look a bit different, or stand out, you can edit anything in between

<?php if (in_category(449) && !$single) { ?>

and

<?php } else { ?>

to give any effect you like. Edit either before <?php or after ?> , in between them isn’t going to show on the code without echo etc. You don’t need anything but

<?php echo wptexturize($post->post_content); ?>

which is what puts the aside in there. All the other bits perform their own little functions, like the comments link, which is also the only way to get to the posts own page. If you don’t want that to be possible, just remove it. (It’s comments_popup_link('(0)', '(1)', '(%)') FYI )

Breakdown

Here I’ll quickly break down the template I provided above, so you know what each and every bit does. It’s all very simple.

<?php if (in_category(449) && !$single) { ?> this bit makes sure the code is shown for asides, and asides only. It’s pretty important
<ul> ul and li are used to make the bulleted list.
<li id="p<?php the_ID(); ?>"> Makes a unique bullet list ID for each post
<?php echo wptexturize($post->post_content); the post content itself
echo ' '; makes a space between the end of the content and the comments link
comments_popup_link('(0)', '(1)', '(%)')?> shows how many comments there have been, with a link to the commenting section.
<?php edit_post_link('(e)'); ?>; if an administrator is logged in, this will show so you can quickly edit the post. it won’t show anything to visitors, though.
</li></ul> closing the bulleted list for this aside.
<br /> a line break, before the next item.
<?php } else { ?> if the item isn’t an aside, then the normal post template below this will apply.

I hope this has helped someone out there, it took me all of 15 minutes to write, and it’s over 900 words long. Feel free to contact me if you have any issues with this, and I’ll try to help out :)

Hello

I'm George Pearce - and this is my personal blog. I'm 18, and I also write about blogging, Linux, and soon, physics. I like to take photos sometimes, and I tweet a lot @pearce.