Raptorize This

An awesome jQuery plugin that unleahes a Raptor of Jurassic proportions… Well, technically it’s Cretaceous proportions, but we’ll let that slide for now.

WE’VE ALL BEEN HERE BEFORE…

You’re sitting at your desk, coding up a 500 page site, knee-deep in Extreme Cheddar Doritos sipping on a liter of Code Red Mountain Dew when you realize…this page would be som much more awesome with a VELOCIRAPTOR. You immediately scramble home to grab your Jurassic Park DVDs so can screencap a Velociraptor attack, but then you realize how hard it would be to make an awesome raptor run across the site you were coding. Plus, how are you going to get that trademark velociraptor screech? How about we let you in on a little secret?

We already did it.

Well, the guys at Zurb.com did it. And I made it into a WordPress plugin.

The Options

What’s that? You want to be able to control the entrance handler? You can! Raptorize can be activated on a click event (that is the default and what we have hooked up above), a timer which just fires after the page is loaded, or the legendary Konami-Code. Our personal favorite is the Konami-Code (but it only works once per page load).

Go ahead, try the Konami Code (↑ ↑ ↓ ↓ ← → ← → B A)

Works when you give a class of button to anything that can be clicked. i.e. <a href=”#” class=”button”>Button</a>

Download here

Try me…

WordCamp Vegoose

Just a little wrap up from WordCamp Vegas that was this last weekend. I had a great time, I am always impressed with the WordPress community. Open, caring, and would literally give you warm cookies just for driving down to Vegas.

This trip was a lot of fun. The conference was great, lots of really good, relevant talks. Highlights included Brandon Dove of PixalJar.net gave a great presentation about Child Themes vs. Theme Framworks. Having built a bunch of custom themes and child themes, personally I have stayed away from frameworks, but after hearing him, I kind of want to dig into Thematic and see what else there is to learn. Also really like when we looked into a site and he said, “This filter applies to all the single ladies.” Kind of a WordPress joke…

I had the opportunity to present myself, and was really happy when John Hawkins invited me to come down at WordCamp Utah. I spoke on the Loop, on how to build custom queries, template tags, and working with custom post types. My slides, similar to the WordCamp Utah ones below:

I also enjoyed hearing the flamboyant Eric Marden and hearing him speak on DevCraft: Best Practices for WordPress Teams. I never worked professionally as part of a dev shop, so his comments were interesting on a lot of levels. Taking a lot of his critique and commentary to heart, hoping to become a better developer as a result.

I guess this brings me to the crux. No one is a perfect developer.  For all of the WordCamps that I have been to, (been to eight now in the last two years) there is always something to learn. For the $20-$30 that they normally cost, there is no better way to spend a Saturday learning from everyone around you on how to be a better developer, better blogger, or better designer.

Hope to see you at the next one!

How to: Point your post permalink to an external site

This was originally posted on ClearSkys.net, but it seems that Barry is going to be shutting down the site. So, that it lives on, I am posting it here. Of note, this is the plugin that I had in mind when I designed that Daring Inspiration WordPress theme.

Any visitors, or subscribers, to John Grubers’ Daring Fireball blog will notice how he uses the post titles as direct links to the sites and information that he refers to within the posts body.

Earlier today WP Recipes posted a quick tutorial on how to set this up on your site (based on work by Vlad Grubman) by adding some code to your themes functions.php file and then changing all the permalink calls within the theme to use the new permalink code instead of the standard WordPress loop function the_permalink().

Whilst this is a perfectly workable solution, it is dependent on modifying your themes functions.php file and all of the pages that include the WordPress loop every time you switch themes (which if you are anything like me, is quite often).

I have modified the code into a small plugin, that when activated, will replace the standard permalink with an external URL without any need to modify your sites theme. I’ve also added an extra filter so that it will replace the permalinks within your RSS feed as well.

The code for the plugin can be found below, and can be downloaded from here: Eternal Permalink. To install, just change the .txt to .php and upload to wp-content/plugins.

`

[php]
<?php
/*
Plugin Name: Enable External Permalinks
Plugin URI: http://jakespurlock.com/2009/09/how-to-point-your-post-permalink-to-an-external-site/
Description: This plugin will allow you to change the post permalink for your posts/pages to an external sites URL
Author: Barry at clearskys.net
Version: 0.1
Author URI: http://blog.clearskys.net/
*/

function cs_external_permalink($permalink) {
global $post;

$thePostID = $post->ID;
$post_id = get_post($thePostID);
$title = $post_id->post_title;

$post_keys = array(); $post_val = array();
$post_keys = get_post_custom_keys($thePostID);

if (!empty($post_keys)) {
foreach ($post_keys as $pkey) {
if ($pkey==’url1′ || $pkey==’title_url’ || $pkey==’url_title’ || $pkey==’external’) {
$post_val = get_post_custom_values($pkey);
}
}
if (empty($post_val)) {
$link = $permalink;
} else {
$link = $post_val[0];
}
} else {
$link = $permalink;
}

return $link;

}

add_filter(‘the_permalink’,’cs_external_permalink’);
add_filter(‘the_permalink_rss’,’cs_external_permalink’);

?>
[/php]

`

To switch a post from using the standard permalink to an external one, you simply add a custom field to the post with a key of url1, title_url, url_title or external. The value of the custom field should be the complete URL you want to link to (including http:// ).