Archive for the ‘WordPress’ Category

Getting the WP-Syntax plug-in to work in WordPress 2.0.x

Saturday, February 21st, 2009

Plugin
Vintage socket photo by porah

I was looking for a WordPress plugin for code syntax highlighting that would work in the legacy WordPress 2.0 branch and discovered WP-Syntax which promised to do the trick.

The system requirements say

  • Requires WordPress Version: 2.0 or higher
  • Compatible up to: 2.7

Except that when installed on a WordPress 2.0.11 installation it threw up an error:

Fatal error: Call to undefined function do_action_ref_array() in \blog\wp-content\plugins\wp-syntax\wp-syntax.php on line 106

Tweaking required

It looks like that plugin doesn’t work in WordPress 2.0.x without a little tweaking. The exceptional WordPress Codex came to the rescue — if only all content management system documentation was that good.

This function is identical to do_action

So I tweaked the code and removed:

106
do_action_ref_array('wp_syntax_init_geshi', array(&$geshi));

and replaced it with

106
do_action('wp_syntax_init_geshi', array(&$geshi));

and lo and behold it worked!

Smarter web design article in .net magazine

Wednesday, October 8th, 2008

Smarter and faster web design

The current edition of .net magazine (October 2008, issue 181) has an interesting feature article entitled “Smarter and faster web design”.

Magazine writer Craig Grannell promises “you don’t need to work harder, or for longer hours, to get better results. You just need to work smarter!” A sucker for productivity tips here’s my take on what he has to say:

1. Get away from the computer

This is one my favourites, and one that I use all the time. Well, not all the time, otherwise you’d never find me at my desk!

Lateral’s Simon Crab offers this thought:

“… today’s web designers have a subconscious belief that the computer will provide an answer as long as they sit in front of it for long enough”

Instead of sitting staring at your design software of choice (Photoshop, Paint Shop Pro Photo, Publisher, Illustrator, Visio, etc.) he suggests going out and get a different perspective on the world. Go to exhibitions, browse magazines at the newsagent, walk around and look around you.

I can’t remember where I first learned this, but it’s been really helpful advice. Get inspiration from other non-Web environments. I’m forever ripping out pages from magazines, scanning them or simply gluing them into a scrapbook. I’ve found inspiration in books, magazines, TV, architecture, fashion, nature … step away from the computer!

2. Explain the idea to a non-techie

I don’t know how many times Jane has patiently sat and listened to me wittering on about some design idea, and then pondered carefully as I finish with the killer question “Does that make sense?”

Crab notes:

“A foolproof test is verbally explaining an idea to a non-designer. If you can’t succinctly explain a concept and get across how it will look and feel, it’s probably not a great idea.”

3. Paper and a pen

This was a tip that struck a chord with me: use simpler tools. Don’t rely on massive, expensive software applications. Get back to basics.

I have a home-made pad of A5 paper next to me on my desks, both at work and at home. Any scrap A4 paper that would otherwise go into the recycling box gets ripped in two and bound together with a foldback clip.

The next bit of advice is from usability guru Jakob Nielsen:

The most important tools for a smart designer are a pen and plenty of paper. This is all you need to do user testing — no fancy lab required. Just sit next to a customer as they attempt to use your website.

Mock things up on paper first. Show it around. Get the big things right first, before you waste time writing code that might never be used.

And for those who say “I can’t draw” advice from GapingVoid:

They’re only crayons. You didn’t fear them in kindergarten, why fear them now?

4. Simpler software

37signals founder Jason Fried:

[Our software products] do a few things really well and get out of people’s way. And when products do a few things really well, they’re more pleasant to work with, and easier to learn and understand.

Find software that does this for you. A few of my favourites:

I use these applications again and again for specific tasks because they’re quick, simple to use and reliable. I’ve got other, bigger applications that will do these tasks but these do it for me quickly.

5. Getting Things Done

Interesting advice from Khoi Vinh from NYTimes.com about GTD:

Unless you really feel GTD is perfect for you, don’t bother. It’s over-rated and just about the (admittedly satisfying) pleasure of organising a system for getting things done, rather than actually getting things done.

I can see that, but I would also say: don’t reject it simply because it doesn’t work for other people. Give it a go, and adopt the things that do work for you, such as a zero-inbox policy.

I was impressed with Andy Budd’s approach to email. He answers emails that take under five minutes, deletes the junk and then files the rest in folders with titles such as:

  • Action
  • Hold
  • Respond
  • Waiting

I’ve been inspired to try something similar.

6. Reuse code

Re-use tried and tested modules of code, for example:

  • Frameworks for CSS, PHP, JavaScript
  • Base it on the default WordPress code (clean, valid and well-structured code)
  • Create your own library of code (many code editors allow you to store these as snippets)

I loved Edward Barrow’s reason for using prebuilt libraries:

He likens using a prebuilt library to “getting an expert programmer to work on your project for free”.

Whenever I do something new I now ask myself whether this is something that I’m likely to need again. If it is I’ll store it as a snippet in WeBuilder 2008, my main code editor.

I categorize everything and have folders and subfolders in my code library arranged like this (I’ve expanded the HTML folder):

  • Apache
  • CSS
  • htaccess
  • HTML
    • !DOCTYPE
    • Basic Tags
    • Elements
    • Forms
    • IE Conditionals
    • Meta
  • JavaScript
  • jQuery
  • Lorum Ipsum
  • Microformats
  • PHP

I’ve got all sorts of goodies in here, that I don’t have to go searching for because I know they are there at my fingertips.

7. Source control

Before I discovered Subversion I used to create my own version control system. But I ended up with umpteen files and folders along the lines of:

[backup-070620]
[backup-070621]
index2.html
index3-test.html

It got ugly, and if I made a mistake or needed to roll back to a previous version I couldn’t very easily do it. I then discovered FileHamster but I couldn’t quite get the hang of it. I found it a little too intrusive.

I was then introduced to Subversion, and discovering that you don’t need to incorporate it into Apache server I installed the Subversion server onto my PC at home and it’s been great! I use the TortoiseSVN client.

Quoting once again from the article in .net:

“In fact, the simplest and smartest investment you can make for any project is to use some sort of version control system,” says Aral Balkan, web developer and conference organiser.

What are your tips?

What are the tools, tips that you find most useful, that make you most productive?

Nearly there … developing a WordPress theme

Friday, August 1st, 2008


Nearly there with WordPress on 12seconds.tv

Today … yesterday … and the day before … in fact, why didn’t I just say “This week…”?!

This week I’ve been playing around with WordPress, trying to work out how best to get the navigation for a site that I’ve been tinkering with — for about two years now” — to work with the least amount of effort.

The site is for the Christian Fellowship of Healing (Scotland), and after much faffing about trying to decide which content management system to use (Joomla!, WordPress, Drupal, ExpressionEngine …?) I’ve finally come to my senses and settled on the mighty WordPress.

So now I’m working on converting my design into a static HTML page, and from there into a fully-fledged, working WordPress theme.

And I’m nearly there. Not least because WordPress has come on in leaps and bounds since I last developed a full site with it. When I last built something big it was with version 2.0.0.8 — we’re now at 2.6, which represents an enormous jump in functionality and usability.

I’ve been playing around with a number of themes making sure that the navigation works as I intend it to. Let’s hear it for:

  • The WordPress wp_list_pages() function.
  • The default wp_list_pages() classes
    • .current_page_item
    • .current_page_parent
    • .current_page_ancestor
  • er…
  • that’s it!

The trial continues tomorrow …

Finding the right CMS for my project

Wednesday, November 21st, 2007

Content Management
Photo by ravennce

Sorry about the lack of proper blogging over the last few days. I’ll tell you what I’ve been doing: I’m looking for the right content management software for a website project I’m working on.

So I’m spending the evenings either trawling through web pages of documentation, trawling through pages of books about specific content management systems, or trying them out for myself either at www.opensourcecms.com or on the vendor’s own website.

What I’m looking for

Ease of use
The clients that I’m working with are not technically-minded — they are ordinary human, sentient, non-geek beings like you and … well, like you (probably) — so the CMS that I pick has to be easy to use.

So that rules out about half the opensource CMS applications out there just now.

Customizable
I need to be able to completely customize the site, as though it was a traditional, static site. I don’t want it to look like a portal with limited blocks of content. Also, it would be great if it could be fairly easily customizable using a combination of mostly XHTML and CSS. I don’t want anything that I have to use an unnecessary amount of PHP just to generate an XHTML document, or translate swathes of code into XLST or YYZ or whatever before it works.

So that rules out about another 25% of systems!

Site structure
I need to easily build the information architecture in it, and (preferably) have the CMS manage and automatically build the sub-navigation lists. It would also be great to be able to see the site structure in some visual form.

There go the rest!

Ideally, I’d like to build it in TERMINALFOUR SiteManager — I could have it built and finished in a couple of days with SiteManager. But unfortunately my clients don’t have a spare £50k lying around to spend on web software!

My current short-list

At the moment my short-list comprises of (in alphabetical order):

Drupal

http://drupal.org/

To be honest, Drupal is currently on my list simply because I haven’t yet ruled it out! But I’m attracted to Drupal and have heard good things about it.

I also own a book about Drupal: Building Online Communities with Drupal, phpBB, and WordPress and Drupal is the only one of the three that I’ve not properly delved into yet.

ExpressionEngine

http://expressionengine.com/

This came as quite a surprise to me, because ExpressionEngine (or EE) is a commercial product, with a very reasonable pricing plan: free for the blog edition or US$99 for the full version if you’re building a non-commercial, or non-profit, site.

I also really like the documentation (there’s lots of it, and some of it is video). But most importantly the back-end looks simple enough to use, and it appears to have the customization features that I’m looking for.
I look forward to checking this out some more …

WordPress

http://wordpress.org/

And of course: my beloved WordPress. WordPress fits almost all of my criteria … and with the creation of some cunning templates I think I could get my customized navigation to work. It may need some cunning PHP tweakery but I know that it would almost immediately fit the bill.

Conclusion

But that’s the thing … I know that I could most easily build the site that I want, with the features that I want with WordPress — it just gets better and better — but I didn’t want to simply take the easy road: I wanted to take a step back and evaluate the opensource CMS scene once again to see what else is out there, and have their back-end interfaces got any better.

Sadly, I think on the whole the answer is a resounding no. WordPress absolutely rocks … I’ve yet to fully understand the CMS model that Drupal uses, and if I end up not going with WordPress then it looks (at the moment) that ExpressionEngine is the way to go … and that’s a commercial product.

Another Potting Shed

Monday, October 29th, 2007

Another Potting Shed

I have Another Potting Shed!

For the last few days I’ve been experimenting with another blog, hosted on WordPress.com, using it much like a “microblog”: short, informal, blether-like posts.

I’ve had that WordPress.com blog for a couple of years now, but not done anything with it. I originally signed-up for it out of curiosity, to see what the hosted accounts were like, so that I could assist friends who had their own blogs there.

This week I thought that it was a shame to waste such a fine space. So I’m now blethering on it. See you there!

Blogging from a phone

Sunday, July 29th, 2007


WordPress viewed on Windows Mobile Pocket Internet Explorer

So there I was, lying in bed with my newly reset PDA phone wondering: could I write a blog post using just my mobile phone, a WiFi connection and include images.

I guess so.

WordPress 2.1 released

Tuesday, January 23rd, 2007

WordPress login screen
The new design for the WordPress login.

The latest version of the WordPress blogging / personal publishing software tool has just been released: WordPress 2.1 Ella. The current 2.x releases are being named after jazz musicians: the last was called ‘Duke’, after Duke Ellington; this one is called ‘Ella’, after Ella Fitzgerald.

Generally it’s faster, slicker and the underlying code is tidier and happier. A few cool new features include

  • autosave,
  • the ability to switch instantly between WYSIWYG and HTML code views while writing posts and pages,
  • the ability to export your blog to XML to import into another blog (or simply to back it up) and
  • the ability to specify which page to use as your frontpage instead of just the latest news items.

I’ve just checked it out on my test server and it’s looking great. I can’t wait to get it installed … once I’ve resurrected my PC. (See previous post for details!)