I thought with the turn of the new year and whatnot, I’d make a few improvements to my blog.
For some reason when I started writing I thought it’d be a great idea to use rather abstract titles for all of my posts, something short and curiously inviting (hopefully) rather than the straightforward approach of actually describing what the post is about. I wanted to avoid long and boring titles like “Differences between Flash Player 10 and 10.1″ or “How to install.. blah blah”.
So although, as far as titles go, they could probably be more boring – they could definitely be more helpful. Most of them are obscure and aren’t really meaningful. They’re fine for human readers, especially after people have read the post, but they’re not so good for search engines or people searching for what I’ve written about.
I decided then to use WordPress’ custom fields to add a descriptive ‘subtitle’ to each post that should shed some light on what I’m actually writing about and hopefully the titles should start making sense.
I could have started anew and use descriptive titles from here on, but that would be inconsistent and make those old titles even more nonsensical. I could have renamed the lot, but the old URLs would then be meaningless (the name is in the permalink) or if I changed those URLs then previously incoming links would be broken.
Custom fields are essentially metadata for each post and can be pulled in by your theme.
I choose to display my subtitle under the each post title so humans, search engines and crawlers alike can read abstract title and the helpful subtitle description together.
Custom fields are added at the bottom of the ‘Add New Post’ page and can be any amount of value pairs that take a name and value.
These custom fields won’t automatically show in your post, you’ll need to edit your current theme’s PHP files to retrieve them.
The get_post_custom function will return a multidimensional array with all custom fields of a particular post or page, which you can traverse to find your custom value pair:
<?php get_post_custom($post_id); ?>
Otherwise you can use the get_post_custom_values function and send the field name to get an array of all the values with that particular key:
<?php get_post_custom_values($key); ?>
I’m using a field to add a subtitle, so I append the value onto the end of my title which you can see on the left (if you’re reading this on my site).
Semantically this is part of my title. As I stated above, for SEO purposes, I want this to be considered as a part of my title for all intents and purposes by search engines and spiders as well as humans. I only ever want them considered ‘separately’ on an aesthetic level and in WordPress’ forming of the permalink.
So I’ve styled up the subtitle to look complimentary to the ‘actual’ title with CSS, but injected it into the post’s h2 title tag in my mark-up so it stays semantically sound for machine readers and accessibility purposes.
So here’s the combined title mark-up (without style hooks):
<a href=”..”>Start Making Sense</a>:
<span class=”entry-subtitle”>Wordpress, SEO and pimping my blog</span>
And the styled and un-styled versions look like this:
It’s subject to a conditional statement that checks whether the custom field has been populated, so I don’t have to rush through adding them to all my posts and those without subtitles yet won’t look broken.
This does mean however that it’s only implemented by the theme, not by the publishing platform. This means it will only be seen by visitors to the blog, it isn’t published to the RSS feed, for example, so syndicated readers won’t see it.
Another improvement for SEO purposes was to add an XML sitemap.
I recently added a HTML sitemap in the form of my index page, but then saw Google’s Matt Cutts discussing HTML versus XML sitemaps who concludes that if you can have both, then do so.
It’s very easy to generate a sitemap and according to Matt’s video a simple list of URLs would suffice, but I looked up the WordPress Plugin Directory for ready-to-roll solution and found the Google XML Sitemaps which does the job for me.
It’s fully automatic so it doesn’t need my attention once I’ve installed it. It generates an XML file based on my current posts and pages and automatically updates whenever I publish or modify anything new.
It also sends notifications of updates to the main search engines – Google, Bing, Ask.com and Yahoo! – and has a number of advanced options concerning prioritising pages and setting the frequency of how often certain pages should be checked again by crawlers for updates.
The XML file it generates sits at http://blog.marchibbins.com/sitemap.xml (for me) and there’s an option to attach an XSL file for styling, but I choose just to use plain XML.
It supports nearly 100 different APIs and the drag-and-drop interface and nice and easy to work with.
I chose not to use it in the end, I thought it was a bit over-the-top for my site.
I made a few other minor changes here and there, some CSS changes and design tweaks.
I threw an RSS link into the header and dropped the amount of posts that show on my front page.
I realised my posts can tend to get pretty lengthy and often have embedded videos or Flash content, so showing ten of those (the default) made the page quite heavy.
I started using the ChaosTheory theme when my blog was freely hosted on WordPress.com and I’ve stuck with it since, making odd modifications to both server-side code and the front-end as and when. To use it on a WordPress.org blog I found a port hosted by Automattic but it’s never been quite right nor entirely compliant with mark-up or CSS standards, I’ve only really maintained it for consistency.
Recently though I found the Unicorn ‘Universal Conformance Checker’ from the W3C which combines all the common validation checks and also has a MobileOK Checker which looks at the ‘mobile-friendliness’ of a site.
Over time it’ll be my aim to get all that sorted. Hopefully without having to start my own theme completely from scratch.