Those pesky most popular posts

Well, after a bit of thinking, I guess I’ve resolved my popular posts problem. The popular posts plugin I was using had a significant flaw — largely because I’m also using the wp-cache plugin. Namely, any cached article was not being registered as having been visited. However, any article which had it’s comments feed accessed was registered as being visited. Therefore, the so-called “most popular” articles were actually the articles which had somebody subscribed to the comments feed. I could control this by closing comments — but this seemed like a highly undesirable way of dealing with the issue. It would only truly be accurate if I closed all comments and reset all counts to zero. Even then, the caching issue would mean that the visit counts would be highly unreliable.

Then there’s the issue of popularity. As I commented previously, I’m not really all that happy with the self-defining nature of popular posts. Once popular, always highlighted. It’s an ineffective way of giving people some access to my past articles. Using the least popular posts really just meant highlighting the most recent posts. Somewhere in the middle? Just kind of a strange way of going about it. Tried it; didn’t really like it.

So I’m now incorporating two plugins: Recent Posts and Random Posts, both by Rob Marsh, SJ. They’re both heavily configurable plugins, allowing me to eliminate selected posts and define the structural code surrounding them amongst other options. I think this will give a more worthwhile glimpse into the “back stacks” of this blog as it continues to grow.

Irritating Widgets

I’m not a big fan of most JavaScript widgets which are added to sites. I have a MyBlogLog account; and I find the statistics to be very interesting. The widgets, on the other hand, I find to be varyingly irritating, obtrusive, and most of all slow.

But there’s one particular widget I’ve seen on many occasions which really drives me nuts: Snap’s “Preview Anywhere”. I really don’t like this. To me, this is information overload. With well-written link text, and good context for a link, I know everything I need to know about a site to judge whether I’m going to go there. Do I need to know what it looks like?

I mean, if I go there, I’ll find out what it looks like soon enough. The suspense isn’t killing me. I’ll admit, there’s the faint possibility that I’ll see the preview and say to myself “Hey! I’ve been to that site before — I’d forgotten how cool it was,” and I’ll follow a link which I would have otherwise ignored.

But it’s a slim possibility.

If my goal for visiting your’s website was to learn more about their links and visit everything they’ve connected to, I’d probably find this widget very useful. However, since my actual goal is usually to read what you have to say, with the possibility that I’ll also check out what you’ve referenced, this Snap widget simply gets in the way.

Lesson to be learned: don’t get in the way of your visitor’s goals. I’ll be honest – there are a number of websites which I find otherwise interesting but rarely visit because of this very widget.

What to do about the most popular posts…

I’ve been thinking about this recently…on the one hand, I want to provide easy access to the posts which are most popular. I’d like to think that these posts are most popular for a reason, in general. On the other hand, once a post is in this “most popular” list, it’s inclined to stay there.

Giving easy access to the posts which are the most popular pretty much guarantees that those posts will STAY the most popular.

Not sure what I want to do about this…I though about making it random; but I’m not sure that would really serve the purpose I have in mind.

Perhaps I’ll just randomly alter the selection – sometimes the top 10, sometimes the bottom 10; sometimes a group somewhere in the middle. I’ll just introduce some variables, and see what happens.

Usable Category Navigation in WordPress Pages

Wordpress isn’t really designed to be used as a CMS. It’s designed for blogging – nonetheless, it’s a surprisingly powerful little content management system, and with a little bit of tweaking you can pretty easily turn it into a nicely flexible system.

One of the challenges that needs to be dealt with is the use of Pages. A “Page,” in WordPress parlance, is a document which sits outside the blog chronology. For the purpose of a CMS, you don’t really want all of your posts to be chronologically organized. You could rewrite the Post templates and the permalink format to eliminate all date information, which would provide you with a nice CMS-like organization – but would also eliminate the blog function. Realistically, you probably want both.

It’s very easy to create a large number of WordPress pages and sort them into a hierarchy. For presentation, the default WordPress function wp_list_pages creates a very nice nested group of unordered lists. This can be styled using CSS to create either a long list of pages with inset sub pages, or a fancy CSS-driven set of drop down or flyout menus.

So far, so good. If you’ve got 10 pages, a single list is fine. But for larger sites, you’re running into other challenges. A straight list of your 150 pages is ugly, difficult to use, and difficult to navigate.

But the classic drop down or flyout menu has some usability issues. For people with mobility impairments, for example, the ability to use a mouse may be limited – and it takes a fair amount of core source hacking in order to attach the javascript needed to make these menus completely keyboard navigable. It’s easy to make certain that the top level link in each category is usable from the keyboard – so your responsibility is to make certain that the top level category link will provide access to all sub pages.

Again, there’s an easy solution: write links to all your further pages into your document content.

Ick. This solution sucks. First of all, if you’re creating this site for a client, you can’t necessarily rely on them to retain the content you’ve carefully created. Second, it’s very awkward to have to hand-maintain links to every page on the site. Why are you using a CMS if you’re going to have to do this anyhow?

Thankfully, although it’s not immediately obvious, WordPress does provide a way to access the children of pages programmatically. Using this code, you can simply create a secondary navigation section which provides easily keyboard-navigable links to all pages below those top level documents.

The Code

<h3>
<?php echo get_post_meta($wp_query->post->ID, 'category', true); ?>
</h3>
<?php 
if(get_the_title($post->post_parent) != the_title('' ,'',false)) {
echo "<ul>";
wp_list_pages("child_of=".$post->post_parent."&title_li=");
echo "</ul>";
}  
if(wp_list_pages("child_of=".$post->ID."&echo=0")) {
echo "<ul>";
wp_list_pages("title_li=&child_of=".$post->ID."&sort_column=menu_order"); 
echo "</ul>;";
} ?>

What’s going on here?

First up has really nothing to do with the navigation menu itself. This is a header for the category navigation menu, arbitrarily placed in a level 3 heading element. It’s a little oddly phrased – this is because WordPress doesn’t provide access to Category labels for Pages the same way they do for Posts. Therefore, this is actually sourcing a Custom Field – a feature available in WordPress which gives you the ability to attahc any custom information to a document. In this case, I’ve created a custom field named “category” which contains the phrase I wish to be considered the category for this item. Generally, it’s the link text of the top level link, although you could set it to be anything you wish.

We’re trying to talk about usability, however, so I’m inclined to suggest sticking to something appropriate.

Note that the code refers to the variables $post and $post_parent. It’s important to know that “Page” is a formality which indicates a post which resides outside the chronology – from a database management perspective, everything is a post.

The second block of code is a tricky bit. This if query is checking to see whether the current page is a subpage of any other page. In general, WordPress has great built-in conditional functions – you can very easily check whether something is a page (is_page() or whether it’s a category page (is_category(). There isn’t, however, an is_subpage() condition. So, this is the workaround – checking whether the current page is not it’s own parent. In WordPress, pages at the top level of the hierarchy are their own parents. (Let’s not get into genetics, here…I’m concerned.)

Next we’ll use the normal wp_list_pages() function. Again, we’re using the information about the post’s parent in order to determine what pages to list, using the child_of argument to retrieve only the Pages which are children of the current page.

Whoa, there! I see a problem!

Yep, you sure do. At this point, we’re only retrieving child navigation if we’re not on the top level page itself. Well, that’s great. You can get between child pages if you can find your way there!

So that second block of code comes into play. Same idea, except this time we’re fetching children of the current page, without checking whether the page is top level. If it’s got children, great – we’ll display ‘em. If it doesn’t – also great – we won’t.

This sytem does also work for multiple hierarchy levels, although it’s a bit awkward. Here’s what you’ll get with three levels in the hierarchy:

  • Top level page, no children: displays category heading, no children. (The category heading could be removed using another conditional statement; I just haven’t done it.)
  • Top level page, with children: displays all descendants (children and grandchildren.) Grandchildren will be in a nested unordered list inside the list item for their parent.
  • Second level page, no children: displays all sibling pages (pages with the same parent).
  • Second level page, with children: displays all sibling pages AND displays the children of the current page, in a nested unordered list inside the list item for that page.
  • Third level page, no children: display all sibling pages at the grandchild level.

And so on. This code functions in WordPress versions 2.01 and above.

Accessible Navigation at Cre8tive Flow

I’ve published my first article at Cre8tive Flow, the Cre8asite Forums blog – Creating Accessible Navigation. In the article I discuss the idea that providing access to content is the overriding goal for the creation of an accessible content and caution against getting too wrapped up in making accessible methods.

Providing a path around an awkward accessibility obstacle may be far more effective than constructing a bridge over it or carving a tunnel through it. And don’t you just love structural engineering analogies?

Profile of a site marketing growth spurt

So, the general shape of blog posting around this time of the year is in the form of “my five predictions for 2007″ and in discussing site statistics for the calendar year. I’m not going to bother with predictions; but I’m going to walk through my statistic through the year and talk about what I was doing in the way of marketing and how those activities impacted my site traffic.

It’s been an eventful year, as these statistics fairly clearly demonstrate:

Joe Dolson Website Statistics

Although any set of site statistics should be taken with a big fat grain of salt, these do seem to show a teensy trend towards more traffic. In the month of January: 156 unique visitors. In December: 4940 unique visitors. What caused this increase?

To be entirely honest, it was a bit of careful planning and intentional personal marketing. Let’s be honest: I’m in business doing accessibility consulting and web design, and I though that increasing traffic to this site might help me in pursuit of that goal.

Month by Month

January

In January, I received, as I mentioned, 156 unique visitors. This is generally along the vein of the traffic I’d receive during the previous year as well, based on, essentially, no marketing at all. I’ve been listed in DMOZ for quite a long time, but as of January that was the extent of my marketing activities.

February

In February, traffic doubled to 300 uniques. This was the result of my authoring a brief tutorial on Blogger. Using the interface, etc. Although most of this information can be found on Blogger’s help pages, this tutorial summarized things nicely. It also mentioned explicity information on uploading documents to Blogger: apparently, a very common question.

This was my first taste of search-based traffic, really: people finding what they want on your site.

March and April

March and April get grouped together because I didn’t really do much more with this site during that time. Instead, I started a second site: inter:digital strategies, a search marketing consultancy. I joined Cre8asite Forums and began to maintain a search marketing blog. Both of these things increased my overall industry profile, but didn’t directly associate with http://www.joedolson.com.

May

In May I authored a pair of articles on Boolean searching with PHP and MySQL, which accompanied a PHP script doing that very task. These were highly strategic: I knew full well that this was a highly specific search query which was currently lacking any valuable search results. I filled it. The articles were posted in mid May: my traffic doubled that month.

June, July and August

During the summer months, I continued to let things grow. I began a blog at JoeDolson.com and backfilled it with a few of my older announcements and articles. I continued posting heavily at Cre8asite Forums and in both blogs. I took a month’s vacation (all of July). I moved from Vienna, Austria to Saint Paul, MN. Traffic kept growing, a mixture of the greater search traffic spawned from my PHP/MySQL articles and the higher profile which was gaining valuable in bound links.

In August, I became a site grader for Accessites, an awesome accessible design showcase, thanks to the invitation of Mike Cherim.

September through December

Kept on writing. Ultimately, this is the key: find an article that needs to be written and write it. Overall, this technique caused my traffic to multiply 35-fold over the course of this year. I spent practically nothing on any other kind of marketing: a couple of quality directory submissions which were probably completely unnecessary, but otherwise my only expense was my own time.

And what has this meant?

At the beginning of the year, my job queries were very slow: I knew a few people who might need websites, and would talk to them and let them know I was available. Every once in a while, I’d receive a cold contact: 90% of this proved to be unqualified leads. This week, I’ve been contacted 7 times so far through my website. Two job proposals, four “thank you” notes for articles, and one offer to become a moderator at Cre8asite Forums. (Thanks, Kim!).

No question in my mind: business profile is the key to success on the web. In my industry, this has meant writing useful articles, helping people out through Cre8asite Forums, and letting people know I’m out here. The key has been writing with people in mind: being friendly, approachable, and responsive. Do I think that my writing alone has made this much of an impact? No, frankly. I think the fact that I’ve also made a concerted effort to respond to blog comments, to respond to every query I receive through my contact form, and that I’ve helped people is what’s ultimately been the most effective marketing tool I could wield.

Page 3 of 4First234

Return to Top