An Event Apart: The Design Conference For People Who Make Web Sites
On a tour to Sweden many years ago, Ringo Starr was asked the following question about his role as the narrator in the famous children’s television series:
“Prior to working on Thomas the Tank Engine, what did you do?”
To which Ringo’s humble reply was:
“I was part of a wee band”.
For some reason, this story stuck in my head, not because of Ringo’s humility or the ignorance demonstrated by the interviewer, but rather, by the fact that anyone working away in any industry can get trapped so deep in their own work that they forget that there’s a whole world out there.
In the case of web design that world is changing fast. Much can be self-taught on the web by reading tutorials, viewing videos and demos but in my opinion, the best way to stay ahead of the curve is to attend conferences such as An Event Apart. When asked why I love going to An Event Apart, I always think of Ringo’s interviewer. Perhaps if he had been less obsessed with Thomas the Tank Engine maybe he would have heard of the Beatles.
Jeffrey Zeldman, Eric Meyer and everyone involved with An Event Apart never fail to impress. Their speaker line-up is always stellar and cutting edge technology is always on the menu. More importantly the speakers are approachable and genuinely nice people. During each others presentation you can find them in the back listening to each other and commenting via blog posts or twitter. How often have you been to a conference where the speaker comes in for his talk and then immediately leaves once done? There’s a sense from both the audience and the speakers, that there’s always something to be learned, no matter how experienced or talented.
As their tagline says, An Event Apart is a design conference for people who make web sites. If you’re in that industry, you should check it out, you will learn something, I assure you.
Use jQuery to hide/reveal children of a WordPress page
I recently launched a beautiful website for Kurt Jurek, registered acupuncturist and herbalist. As some of you may know, Chinese medicine can be used to treat a huge amount of ailments. As a result when putting together content, the amount can be overwhelming and difficult to organize. Combine this with the need to use a CMS and you’re task is quite daunting. This is when adding a bit of JQuery to your WordPress theme helps.
My number one task when setting up WordPress as a CMS for a client is to make updates easy to understand. If clients need to use HTML in their admin, then I consider this a failure. WordPress in itself is quite easy for most people to grasp and understand and it should be the case at all times.
Continue reading »
Modifying the WordPress admin
I’ve been using WordPress to build 99.5% of my sites lately. Even if a particular client doesn’t need a blog or won’t be making frequent changes, I do like to provide the ability to update content if needs be.
As a result, the WordPress back end has too many features for such a client. After reading the tutorial from Six Revisions, I’ve been modifying the WordPress admin, but using the following:
/* Remove Posts, Comments and Links from Admin menu items */
function remove_menu_items() {
global $menu;
$restricted = array(__('Posts'),__('Comments'),__('Links'));
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){
unset($menu[key($menu)]);}
}
}
add_action('admin_menu', 'remove_menu_items');
Once added to my functions.php file, the menu items posts, comments and links disappear. How handy is that?
Updates to the WordPress Comment Form
Justin Tadlock recently wrote a great post and tutorial aimed at theme developers. His article pointed out that with the release of WordPress 3.0, a new function for handing comment forms: comment_form(), was introduced.
This new function offers much more flexibility for plugin authors and is really easy to use. All you have to do is open up your comments.php file and locate this bit of code:
<div id="respond"> Lots of HTML code to output form elements. </div>
and replace it with:
<?php comment_form(); ?>
You may also need to tweak your CSS, but overall, that’s the only change needed.
I took Justin’s advice and updated my basic theme and noticed a few things.
- The default title is Leave a Reply
- The default submit value is Post a Comment
- The comment after the form ‘You may use these HTML tags…‘ was added
In order to change these easily, I updated my function file with the following code:
<?php
//Change comment form defaults
1<?php
//Change comment form defaults
add_filter( 'comment_form_defaults', 'basic_comment_form_defaults' );
function basic_comment_form_defaults( $defaults ) {
$defaults['label_submit'] = __( 'Submit' );
$defaults['title_reply'] = __( 'Leave a Reply' );
unset($defaults['comment_notes_after']);
return $defaults;
}
?>
Displaying latest and most popular blog posts in your WordPress footer
Fat footers are very handy for displaying additional information on your site. On a previous version of this website I used to display the latest blog posts, while on this newer version I opted to display the popular posts. I thought I would share these code snippets here.
Display Recent Blog Post
In your footer.php file, simply use the following code:
<ul>
<?php query_posts('showposts=10');?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
Simply change ‘showposts=10′ to whatever number you want to display more or less than 10 posts.
Display Most Popular Blog Posts
“Most popular” posts in this case is defined by the posts that have the most comments. In order to select these, the following pieces need to be used:
1. Add the following function to your function file:
function most_popular_posts($no_posts = 10, $before = '<li>', $after = '</li>', $show_pass_post = false, $duration='') {
global $wpdb;
$request = "SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS 'comment_count' FROM $wpdb->posts, $wpdb->comments";
$request .= " WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish'";
if(!$show_pass_post) $request .= " AND post_password =''";
if($duration !="") { $request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) > post_date ";
}
$request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts";
$posts = $wpdb->get_results($request);
$output = '';
if ($posts) {
foreach ($posts as $post) {
$post_title = stripslashes($post->post_title);
$comment_count = $post->comment_count;
$permalink = get_permalink($post->ID);
$output .= $before . '&raquo; <a href="' . $permalink . '" title="' . $post_title.'">' . $post_title . '</a>' . $after;
}
} else {
$output .= $before . "None found" . $after;
}
echo $output;
In this function, I’ve set the number of posts to 10 – ‘$no_posts = 10‘. Just change this number to display more or less posts.
2. Insert the following in your footer.php
<ul> <?php most_popular_posts(); ?> </ul>
WordPress revision control
In an earlier post, I discussed the handy revision control plugin. Plugins are awesome and I truly have immense respect for plugin developers, but I do find them a bit tedious to maintain and sometimes a bit of an overkill.
I am constantly fiddling and updating over 30+ client sites at a time. If WordPress and plugin updates didn’t come out as frequently, I would be more than happy to load my sites with dozens of plugins, but I do find simpler non-plugin methods more handy.
I recently discovered that post revisions can be disabled or limited simply by adding the following bit of code to the wp_config.php file.
define('WP_POST_REVISIONS','5'); //Will limit revision to 5 revisions
define('WP_POST_REVISIONS','false'); //Disables revisions totally
Personally, I think that one line of code is better than a plugin.
Display your latest tweet(s) on your website
I recently worked with Magnify Digital on a website for a very interesting group of people in the Fraser Valley. These folks are concerned about Air Quality and thus have come up with a website and community to address these issues.
A big part of the website was the social media aspect. Thus facebook, twitter and youtube feature prominently on the website. There are plenty of WordPress plugins that allow you to display your latest tweets, but I wanted a simpler solution. The following piece of code proved to be just what I needed:
<?php
$username = "yourTwitterUsername";
$limit = "1"; // Number of tweets to pull in.
/* These prefixes and suffixes will display before and after the entire block of tweets. */
$prefix = ""; // Prefix - some text you want displayed before all your tweets.
$suffix = ""; // Suffix - some text you want displayed after all your tweets.
$tweetprefix = "<p>"; // Prefix - some text you want displayed before each tweet.
$tweetsuffix = "</p>"; // Suffix - some text you want displayed after each tweet.
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=" . $limit;
function parse_feed($feed, $prefix, $tweetprefix, $tweetsuffix, $suffix) {
$feed = str_replace("&lt;", "<", $feed);
$feed = str_replace("&gt;", ">", $feed);
$feed = str_replace("&quot;", "\"", $feed);
$feed = str_replace("&apos;", "'", $feed);
$clean = explode("<content type=\"html\">", $feed);
$amount = count($clean) - 1;
echo $prefix;
for ($i = 1; $i <= $amount; $i++) {
$cleaner = explode("</content>", $clean[$i]);
echo $tweetprefix;
echo $cleaner[0];
echo $tweetsuffix;
}
echo $suffix;
}
$twitterFeed = file_get_contents($feed);
parse_feed($twitterFeed, $prefix, $tweetprefix, $tweetsuffix, $suffix);
?>
Basic blog theme updated
A few years ago, I was asked to teach how to use WordPress to students enrolled in the Electronic Media Design Program at Langara. The goal was to provide the students with enough knowledge and understanding of WordPress so that they can create an online portfolio.
Once the curriculum in place, my first decision to make was what theme to start with. At the time, WordPress version 2.6 was around and I didn’t particularly want to use the Kubrick theme. I always disliked it and found it too messy. I had built quite a few sites with a now defunct theme, and decided that if I removed all of the unnecessary code and style, this theme would be a great starting point for my class and all of my projects. Thus was born the Basic Blog theme.
This theme has all the functionality of a typical WordPress theme but very little styling. It’s a bare bones theme or a framework for you to work from and has the following following features:
- Two column website measuring 960px wide.
- Widget enabled.
- Sidebar can be positioned on the right or left simply by switching the float direction in the CSS.
- Can be used to create a website with blog and static pages or just static pages if no blog is required.
- Requires no plugin.
Having gone through 3 intakes of students, I’ve had many opportunities to refine the theme. With the release of WordPress 3.0, I’ve now had to make further updates and the theme now also includes the following:
- Custom post thumbnails
- Custom menus
- Easy jQuery integration
- Excess information from header file is removed
Here’s a copy of the Basic Theme for you to download and play with. If you have any suggestions, comments on how it could be improved, please let me know.
I would also like to say thanks to Tzaddi and Catherine for providing their input on this theme and of course to all my EMD students who have thought me so much.
Bluelime Media gets a facelift
It would be nice if things stayed the same, but they don’t. In fact things like business goals, plans, strategies, constantly need refining and tuning. Over the years I’ve had many opportunities to grow develop and learn new skills. Of course these changes have consequences, one of which is the need for a website refresh.
Today is the launch of Bluelime’s fourth website re-design. I’ve revised and reduced the content to bring clarification of my skills. I’ve also cleaned up the blog. I know that some folks don’t believe in killing blog posts, but I just couldn’t have old, irrelevant info and I must confess, I’m addicted to the delete button.
I also inserted various jQuery elements. I’m not a jQuery ninja and I don’t think that I’ll ever be, but these few elements were easy enough to achieve and are here to showcase what can be done.
I’d like to thank Todd for editing my website content and Kathleen for her visual input.
Hope you like the new look. Let me know what you think.
Is WordPress a Content Management Solution?
I had the privilege of sharing the stage with Cameron Cavers and Dave Zille this weekend at
WordCamp Vancouver, and discussed the merits of using WordPress as a CMS.
Some of you might have disagreed with me when I answered No to the question ” Is WordPress a CMS?” I probably should have said Yes AND No…
I’ve been using WordPress for a number of years now. Version 1.2 might have been the first version I worked with. Originally built as a blogging platform, WordPress 1.2 mainly focused on Posts. The ability to display anything but your blog posts on your home page didn’t exist and I’m not even sure Pages were around. When compared to larger CMS built by Oracle, IBM and Microsoft some would argue that WordPress isn’t a CMS mainly because of the lack of approval process. Content types in WordPress are also limited, but WordPress 3.0, due for release anytime soon, is about to change that. Custom post type and menu management will offer us much more flexibility to manipulate content and thus enhance WordPress’s CMS ability. No changes in approval processes are expected for WordPress, but personally I don’t think that there’s a need for this. If this is all that it takes for WordPress to gain the title CMS, then I think it can do without. Organizations and companies looking for sophisticated approval processes usually have many layers of bureaucracy and probably won’t be looking for a free CMS anyway.
Looking back at an older versions of WordPress, it’s interesting to see how the platform and community has evolved. I’m not sure that Matt and the folks at Automattic perceived that one day WordPress would become much more than a blogging platform and be used as a CMS. I can only see great improvements and exciting features when I look at WordPress’s evolution and I won’t be looking at another CMS solution for a long time.
