Recent Launches
In the past few months I’ve launched a few projects – I’m planning an in-depth post about each of them, but for now here’s some images and links.
In the past few months I’ve launched a few projects – I’m planning an in-depth post about each of them, but for now here’s some images and links.
URL: http://www.timberlinelodge.com
Agency: Nemo
Role: Lead Developer
Technology: PHP / Wordpress
Featured in the Wordpress Showcase
The following code will let you create a custom “Wordpress Loop” that contains the post objects of the children of the current page.
Just drop this code in your theme file:
<?php $project_list = get_posts('numberposts=5&order=ASC&orderby=menu_order&post_type=page&post_parent='.$post->ID); foreach($project_list as $post): setup_postdata($post); ?> <div class="post" id="post-<?php the_ID(); ?>"> </div> <?php endforeach; ?>

In a current project I’m reading in a user’s Twitter feed and displaying it on the hompage of their Wordpress blog. I know that there are a thousand plug-ins that exist to do this exact thing, but I wanted to write my own.
Using the official Twitter API the contents of the individual were returned as plain text, meaning that all HTML links were totally dead. I wanted a way to automatically add the HTML to enable URL’s as well as twitter “@” profile links. I found some regular expressions and with some tweaking came up with these 2 functions.
To activate the URLs in block of text pass it to the following function:
function activateURLS($tweet) { return preg_replace("@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@", "<a href="$1" target="_blank">$1</a>", $tweet); }
To activate Twitter @ profile links using the following PHP block:
function activateTwitterProfiles($tweet) { return preg_replace("/@([^ ,.!#$%^&]+)/", "<a href="http://twitter.com/$1" target="_blank">@$1</a>", $tweet); }
They’re super easy to use, just call them like this:
activateTwitterProfiles(activateLinks($tweet->text))
Thought Wordpress nerds might find this useful, a function to retrieve a list of posts by passing in a custom filed key=>value pair, with an optional count parameter.
Just drop this in your “functions.php”:
function getPostsByMeta($key, $value, $count = -1) { global $wpdb; $sql = "SELECT DISTINCT wp_posts.post_title, wp_posts.ID FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->posts.post_status = 'publish' AND $wpdb->postmeta.meta_key = '$key' AND $wpdb->postmeta.meta_value = '$value' ORDER BY post_date DESC"; $sql .= ($count != -1) ? " LIMIT ".$count : "" ; return $wpdb->get_results($sql); }
and then you can use it like this:
$news_home = getPostsByMeta('_tb_post_section', 'News', 3);
<?php foreach ($news_home as $news) : ?>
<!-- OUTPUT TEMPLATED HTML -->
<?php endforeach; ?>
I make no secret of my love Wordpress, and when I’m talking with other developers one of the things I constantly hear is “You can’t use Wordpress as a CMS” – this was a constant theme at WordCamp Portland. Now – for the most part I agree with this statement – but only to a certain extent. Wordpress isn’t the solution to EVERY problem on the web like some evangelists would say, BUT that doesn’t mean that it can’t be used as an effective small-to-mid size CMS solution.
Why would I want to use Wordpress as a CMS?
extensible plug-in architecture – I can’t stress how much power this gives a developer with a working knowledge of PHP, and if you don’t write your own there literally tens of thousands of existing plug-in out there to do most anything you could want.
access to the wordpress administration interface – Happy Cog designed it, what else is there to say?
access to one of the best user communities in existence – There’s a TON of nice people using Wordpress, and they LOVE it – when was the last time you saw an ad for ExpressionEngineCampDesMoines?
it’s easy to develop for – The templating system is well thought out and powerful, and once you learn how to harness the power of custom hooks, actions, and filters you’ve got a very powerful framework at your fingertips.
Case in point: Here’s the last project that I did while at NEMO for local Portland, Oregon ski resort Timberline Lodge:

The client came to us using a custom version of ModX that someone had hacked together for them a few years ago. Although I had never even heard of ModX – I correctly guess that they was only using a tiny subset of it’s immense feature-set. Wordpress made the most sense because the client wanted a strong SEO ranking, an intuitive interface that his staff could pick up easily without a lot of training, as well as something where the presentation was de-coupled from the CMS allowing him to update the front-end easily.
Built on a single Wordpress install, this site allows for management of it’s custom data through the use of a number of custom plug-ins that read / write from their own custom database tables. This allowed me to leverage the Wordpress framework while still using a non-post like data structure. Bits like this are used throughout the entire site, but most notably on the conditions page, where the team at Timberline is able to update all of the recent weather data through the Wordpress admin interface.
The page structure is managed through the use of flexible “tag grids” to build the subpage grid structure. Pages are just posts, and on the desired page shortcode is used to create a grid of posts based on the tags provided as parameters to the shortcode…. like this:
[tag-grid tags="lodging, history"]
Which would a retrieve a list of posts tagged with “lodging” & “history” and would produce a grid that looks kinda like this:
The addition of this “build-your-own” grid system gave me the flexibility to manage all of the “pages” of the site – no matter where they sit in the site structure – as regular post objects with little-or-no data differentiating parent from child, or top-level from third-level.
The site also allows external social networking tools to do some of it’s work. We’re bringing in the contents of a Flickr group to act as the photo gallery, and the “likes” of the Timberline Viemo account as a video gallery. We’re also using the Timberline twitter account for external communications that provide up-to-the-minute weather reports via SMS without lifting a finger. As with other parts of the site, all aspects of the connections to external tools are written as custom plug-ins and managed through the Wordpress interface.
I would say that people who categorically dismiss Wordpress as a CMS option most likely just don’t know how to use it well enough.

The site I recently put together for Dave Seoane Furniture was featured on SurfStation this morning.
Design by Chris Hotz @ NEMO
Nate and I grew up together, and I consider him to be the BEST WordPress developer in Portland right now. I’m happy to see that someone out there is using WordPress in new and exciting ways, and his knowledge and insight has gotten me out of more than a few jams. His work totally inspires me, and I think it shows us that WordPress is more than just a simple blogging platform.
Nate works locally for Alpha Multimedia or you can find him at the blog that he never updates.
Here is some of his recent work (all in WordPress):

Pear Panache
OurPDX mentioned my session at Wordcamp saying:
from superfancy’s roundup of Wordcamp Portland:
“Dane led us through all the essential aspects of WP plugin creation from initial idea to execution to helpful documentation available at the WP Codex to help if you get stuck. My ten dollar admission was worth it for this session alone. Dane posted his Keynote presentation as well as the files we worked through on his site. I really wished I would’ve talked to this dude but alas it was time for me to go.”