Upgrading WordPress tags

Filed under: Blogging, WordPress — kathyjay at 5:33 pm on Tuesday, September 23, 2008

A while ago I noticed that the Blogroll had disappeared from this blog. As with so many things during my final months at my previous job, I just didn’t have time to dig through the WordPress documentation to find out why.

Today I did some nosing around and discovered that the old WP tags to generate the blogroll had been deprecated and removed a while ago. Hence the non-working blogroll.

One of the nice things about WP is the resources out there documenting how all the nuts and bolts work. If you really wanted to, you could customise WP to run an entire, complex website and not just a simple blog like this.

I came up with the new wp_list_bookmarks tag that was needed to replace the old code. Part of me sighed at the idea of upgrading to break people’s blog templates, but another part of got a little excited about the fact that this would be much easier than my old code.

To demonstrate, here is the old code:

<?php
$link_cats = $wpdb->get_results(
"SELECT cat_id, cat_name FROM $wpdb->linkcategories");
foreach ($link_cats as $link_cat) {
?>
<li id="linkcat-<?php echo $link_cat->cat_id; ?>">
<h3><?php echo $link_cat->cat_name; ?></h3>
<ul>
<?php get_links($link_cat->cat_id, '<li>', '</li>', '',
FALSE, 'name', FALSE); ?>
</ul>
</li>
<?php } ?>

Using the new WP tag, I have one line of code:

<?php wp_list_bookmarks('title_before=<h3>&title_after=</h3>'); ?>

It does essentially the same thing, only much less wordy. The wp_list_bookmarks tag defaults to ordering by name (something that had to be specified in the get_links tag) and retrieving all the categories. The one frustration is that it defaults to putting the category names in H2 tags, but that’s what the title_before and title_after parts of the argument do - change that behaviour to H3 tags so that I don’t have to re-jig the CSS.

WordPress has its negatives (the frequency that you have to upgrade and the time it takes to do the upgrade being the biggies) but it does have some nice features hidden under the bonnet. I’m not sure that anyone could use them if they don’t have at least a basic understanding of PHP first, though!

CSS IE7 compatibility and Wordpress updates

Filed under: Blogging, WordPress — kathyjay at 4:36 pm on Tuesday, September 23, 2008

I have been intending to go in and fix Above the Fold for months. Months and months and months. Why?

When Internet Explorer 7 was released they fixed a number of the escapes that had been used to target IE with fixes where the CSS doesn’t render correctly. Sadly they didn’t fix the CSS rendering. The layout on this site uses some clever CSS to create the three-column layout without needing to resort to tables yet maintaining the liquid layout so that it scales to any screen size.

I did some research when IE7 was first released and found some references to fixes. They involve stripping the overrides out of the main CSS file, putting the overrides into a new file and then using conditional comments to link to that new file. e.g.

<!--[if IE]>
<link rel=”stylesheet” type=”text/css” href=”ie_overrides.css” />
<![endif]–>

The bit that I was scared about was working out exactly where those overrides were in the default layout file. There always seemed to be something else that needed to be done more urgently so it got left.

And left.

Today I dusted off that default CSS file, went through it with a fine tooth comb and discovered that the six lines of code that I needed to move (much less than I’d imagined) had all been grouped together and commented as IE hacks. It took me less than thirty minutes to sort it out - if only I’d know that months ago!

The slightly more complicated part was repeating that process for the WordPress files. In the default stylesheet for WP I’d helpfully put all the IE hacks at the end so they could easily be found. The more difficult bit was working out what link to use for the IE override stylesheet. A bit of Google-fu solved the problem and I added this to my header file:

<!--[if IE]>
<link rel=”stylesheet” type=”text/css” href=”/ie_overrides.css” />
<![endif]–>

I’m quick surprised by how much easier it was to sort out than expected. In fact, the most complicated part of today’s operation was upgrading the WordPress installation! That really isn’t my favourite job but it does have to be done for the security updates if nothing else.

Welcome back to functionality

Filed under: Blogging, General — kathyjay at 8:33 pm on Wednesday, February 27, 2008

This blog has been cleaned up, dusted down, upgraded to the latest of everything and made properly functional again. Hooray!

On checking the status of the blog a couple of weeks ago, I noted that the posts were ordered backwards. A quick search of the forums revealed that this was a common problem when hosts had upgraded their MySQL and users had not upgraded their WP blog (guilty as charged) but unfortunately I jetted off to Canada for a few days and I have only just had the time to sit down and properly sort out the upgrades.

Never mind. I’ve dusted off with the intention of being a little better at blogging here so we’ll see how it goes this time.

The learnings from LiveJournal kerfuffles

Filed under: Blogging — kathyjay at 4:14 pm on Saturday, June 2, 2007

One of the interesting things about the blogosphere is how quickly rumours and stories circulate. The latest kerfuffle on LiveJournal illustrates this particularly well and also shows how much the control of the web is changing.

Early in the week, LJ deleted around 500 journals that had suspect phrases in their interests and profiles. It was an attempt to crack down on people using the system to co-ordinate child abuse, but backfired rather spectacularly on them. In that list of 500 journals were a number of community and personal journals that had nothing to do with child abuse. They were fan communities, many of them fanfiction, that happened to have some unfortunate phrases in their profiles. Leaving aside the issue of why they had those phrases in the profiles, the ensuing uproar spread incredibly fast.

Within a day, pretty much every fan (whether involved with fanfiction or not, whether members of those communities or not) had heard about it and were angry. The news spread into the mainstream, non-fan world almost as fast. This was probably helped by one of the affected communities being a Spanish-language community discussing Nabokov’s Lolita.

The story hit CNet by Wednesday and other IT-related sites picked it up.

On Thursday, Six Apart (owner of LJ) CEO Barak Berkowitz gave in and apologised, promising to restore the journals that shouldn’t have been deleted and take steps to improve the way they handle this kind of thing in the future. A lot of fans (and Spanish book fans) are still annoyed, not least about being tarred with the same brush as child molesters. In fact, LJ has now released three apologies on their news page and various apologies on IT news sites, including CNet. Rather than trying to blame it all on mis-information or one person taking an initiative too far, they’ve been honest enough to admit that they just plain mucked up.

Still, a lot of fans are talking about boycotting LiveJournal and finding a new blogging platform for fan activities.

One of the interesting facets is the rumours that went around associated with the mass-deletion. The big rumour, that everyone including fans have been trying to dispell, is that LJ shut down support communities for rape and abuse survivors. Although that one is a myth, it’s been a hard one to counter and is part of the reason why so many non-fans became involved.

As an observer, the interesting thing is just how quickly the information got out there and how fast the back-lash got organised. In pre-Internet days, it would have taken days or even weeks to get that kind of response going. Now, a story gets into the blogosphere and spreads faster than fire. It’s almost impossible to keep a story - particularly a juicy one - quiet in these days of modern, near instantaneous communications and bloggers are large part of this.

It’s also a lesson for other service providers. What LiveJournal did, on the surface, should have been a good thing. Their handling of it all was at fault. The massive response shows that corporations need to think carefully before taking actions that will anger their core customers. A journal that was set up for fans to register their presence (not aimed at those fans immediately affected by the journal deletion but rather at anyone who considers themselves a fan) has had over 32,000 LJ users “friend” it in just four days. When you consider that this is probably only a portion of the fans, that’s a surprisingly high number and emphasises just how widely the news spread. Social networking sites have to keep their eye on the ball, know what the make-up of their users is, and use that information whenever they are planning any kind of big (or even relatively small) change.

I’m going to be intrigued to see how things at LJ go over the next few months. Usually things calm down after a couple of weeks of kerfuffle, but I suspect that this one might have a more long-lasting effect. Many users, even non-fans, are now setting up alternative locations as a just in case back-up. Lots of users are planning to stop paying LJ for the advanced services. I suspect that other sites, such as MySpace and Blogger, will be looking at what happened and rapidly revising some of their strategies to make sure they don’t repeat LJ’s mistake. At the end of the day, the story won’t be about how LJ heroically broke up paedophile rings, it will be about how LJ annoyed thousands of users with a poorly planned purge of journals and had to apologise and reinstate most of them.

LiveJournal’s attempt to be the good citizen has back-fired on them spectacularly because they didn’t think things through properly.

An interesting take on the whole thing can be found at stewardess_’s journal: How Six Apart’s Greed Allied Them with Neo-Nazis (warning: some bias evident!)

A mission statement, of sorts

Filed under: Blogging, General — kathyjay at 7:04 pm on Thursday, March 29, 2007

I have been putting off making this post for a while, largely because I had not quite made a decision. Well, now is the time to make this post and begin the next chapter of Above The Fold.

This blog was originally created to provide regularly updated content for this site and reassure visitors that I haven’t simply slapped a portfolio up on the web and never touched it again. I had vague intentions of blogging about things that might be of interest, but I wasn’t sure quite what that would be and over time I’ve written the odd post on politics, some food things and even some funny work stories mingled with the slightly more technical posts. It’s never had a consistent theme, though, apart from an intention that it will not contain personal things that only friends and family would be interested in.

That intention has not changed and it’s time that I dusted things off, began again and this time actually write with some idea of what the blog is really about as well as what ultimate purpose it serves within the context of the a portfolio site.

A large part of this decision was inspired by an article on A List Apart about writing for the web and for blogs and it has some very sensible suggestions. The point that resonated most was about knowing why you’re writing being as important as what you’re writing and writing as if for a single reader rather than trying to cater to an “audience”.

My decision to keep personal things off this blog still stands and to that end I’ll be setting up something separate for friends and family to keep up with my activities and keep in contact. This blog will be what it should be: a blog with purpose, sharing interesting or useful websites that I have found, passing on tips and tricks found through my work, discussing projects that I am involved in - analytical or web related - and filled with my excitement at finding some new cool technical gadget or piece of software. In short, it will be related to the rest of this portfolio and my professional life with a commitment to write at least two articles a month.

I hope.

Next Page »