TOPIC: WORDPRESS
Extra WordPress editor options
24th February 2007Solo Technology has posted about a nice extra available in the Visual Editor in WordPress 2.1. Hit ALT+SHIFT+V in Firefox and ALT+V in IE, gets you an extra row of buttons adding more editing options. He is currently trying to add a button to the main bar for doing the toggling.
P.S. While on the subject of blog post management, I have been playing around with w.bloggar
, and I have to say that it works well; with a spot of persuasion, it even edits WordPress blog pages. The only things attempting to spoil the experience are the odd instances where odd characters get added to blog posts or characters in posts get misinterpreted. I'll try to add more in time.
HennessyBlog theme update
12th February 2007Over the weekend, I have been updating the theme on my other blog, HennessyBlog. It has been a task that projected me onto a learning curve with the WordPress 2.1 codebase. Thus, I have collected what I encountered, so I know that it’s out there on the web for you (and I) to use and peruse. It took some digging to get to know some of what you find below. Since any function used to power WordPress takes some finding, I need to find one place on the web where the code for WordPress is more fully documented. The sites presenting tutorials on how to use WordPress are more often than not geared towards non-techies rather than code cutters like myself. Then again, they might be waiting for someone to do it for them…
The changes made are as follows:
Tweaks to the interface
These are subtle, with the addition of navigation controls to the sidebar and the change in location of the post metadata being the most obvious enhancements. “Decoration” with solid and dashed lines (using CSS border attributes rather than the deprecated hr
tagset) and standards compliance links.
Standards compliance
Adding standards compliance links does mean that you’d better check that all is in order; it was then that I discovered that there was work to be done. There is an issue with the WordPress wpautop
function (it lives in the formatting.php file) in that it sometimes doesn’t add closing tags. Finding out that it was this function that is implicated took a trip to the WordPress.org website; while a good rummage in the wp-includes
folder does a lot, it can’t achieve everything.
Like many things in the WordPress code, the wpautop
function isn’t half buried. The the_content
function (see template-functions-post.php
) used to output blog entries calls the get_content function (also in template-functions-post.php) to extract the data from MySQL. The add_filter
function (in plugin.php) associates the wpautop
function and others with the get_the_content
function to add the p
tags to the output.
To return to the non-ideal behaviour that caused me to start out on the above quest, an example is where you have an img
tag enclosed by div
tags. The required substitution involves the use of regular expressions that work most of the time but get confused here. So adding a hack to the wpautop
function was needed to change the code so that the p end tag got inserted. I’ll be keeping an eye out for any more scenarios like this that slip through the net and for any side effects. Otherwise, compliance is just making sure that all those img
tags have their alt attributes completed.
Tweaks to navigation code
Most of my time has been spent on tweaking of the PHP code supporting the navigation. Because different functions were being called in different places, I wanted to harmonise things. To accomplish this, I created new functions in the functions.php for my theme and needed to resolve a number of issues along the way. Not least among these were regular expressions used for subsetting with the preg_match
function; these were not Perl-compliant to my eyes, as would be implied by the choice of function. Now that I have found that PCRE’s in PHP use a more pragmatic syntax, there appeared to be issues with the expressions that were being used. These seemed to behave OK in their native environment but fell out of favour within the environs of my theme. Being acquainted with Perl, I went for a more familiar expression style and the issue has been resolved.
Along the way, I broke the RSS feed. This was on my off-line test blog so no one, apart from myself, that is, would have noticed. After a bit of searching, I realised that some stray white-space from the end of a PHP file (wp-config.php
being a favourite culprit), after the PHP end tag in the script file as it happens, was finding its way into the feed and causing things to fall over. Feed readers don’t take too kindly to the idea of the XML declaration not making an appearance on the first line of the file. Some confusion was caused by the refusal of Firefox to refresh things as it should before I realised that a forced refresh of the feed display was needed. Sometimes, it takes a while for an addled brain to think of these kinds of things.
Blogging with Word 2007
1st February 2007Though it seems strange to say it, I am making good use of Word’s blogging capabilities. Having had WordPress.com’s blog editor mangle one of my posts – incidentally while using Opera as my browser - is the cause of this turn of events.
When setting up new accounts, there are a number of presets available to be used to work with major blogging providers such as Blogger, WordPress, and Typepad. This is not all, though, as it is possible to hook up to other blogs in a more generic fashion. In fact, I have able to hook up to my other WordPress-powered blog; hosted on the same server as my personal website and with all the associated programming and scripting handled by myself. Where you have a number of accounts set up in the application, a drop-down menu appears in the post so that you can select the account to be used.
Speaking of dropdown menus embedded in the post, you can add categories to a post from the blog server’s own collection, and you can have more than one in any post. This feature is a boon, as is the ability to edit posts that are already on there, yet Word only seems to show a subset of all the posts on the server, about 20 I think, rather than each one. Another caveat is that you need to use a separate window for each post, or you’ll end up overwriting posts in error. Whether this is a result of RSS feed settings or is intrinsic to Word itself remains something that I have yet to discern. As it is Word, formatting, insertion of objects such as hyperlinks and images is very much part of the package. That said, uploading images via this route was not something that I tested until I was writing this post, but it seems to work well.
Apart from the irritations discussed above, I did find Word crashing a few times, but no data got lost thanks to its seemingly excellent file recovery capabilities, a definite counterpoint to some of my experiences with Word’s file recovery feature in previous versions. Eventually, the Office Diagnostics tools kicked in to see if all was well and, after carrying out both hardware (memory, hard drive, etc.) and software checks, an installation repair was performed. Let’s see if this resolves the issue. Even so, the crash repair and diagnostics were not something that I had seen to the same extent in previous versions of Office, and they did look pretty impressive.
In summary, Word does seem to be a good blogging tool, but I wouldn’t use it on its own because of its inability to download a full list of posts for editing. A blog’s own interface will remain necessary for that. Also, Word is far from being the only “offline” blog editor out there, and I am tempted to have a look at the likes of BlogJet and w.bloggar
.
Post titles on Technorati
28th January 2007I have had a look at how the posts from this blog are listed on Technorati and most if not all the titles are coming through as "Permalink". I was going to try WordPress.com support, but they are off for the weekend. A trip to the WordPress.com forums was then in order and a few helpful folk put me right on this one: apparently Technorati uses the permalink titles when extracting post summaries from WordPress.com blogs and in the Andreas04 theme that I am using, these are all hard-coded as "Permalink". I have left the theme's author in on this and going to try WordPress.com feedback tomorrow. In technical terms and from what I can see, the fix needed is as follows: change title="Permalink"
totitle="Permanent Link: "
in the single.php, page.php and index.php files in the theme.
New domain name
25th January 2007I have registered the domain technologytales.com for this blog yesterday and have since got the DNS configuration completed. I used Easily.co.uk for the registration; they also host my other domain name and have done so since I first registered it. Easily allowed me to transfer to the WordPress.com namespace servers and $10 secured the rest of the setting up and $10 every year at renewal time with keep things in place. There is more about doing all of this on the WordPress FAQ.