Tweets from the week before 2010-02-15

  • This year's super bowl commercials were mostly lame, repetitive, and lacking originality. #SerialCommaMonday #
  • Only 9 more hours to submit your #CocktailCamp presentation ideas. Some great ideas in already, but we want YOURS! bit.ly/9Encg9 #
  • @chrishalebarnes What did a new line ever do to you to deserve your scorn? in reply to chrishalebarnes #
  • .@SouthwestAir Why don't you offer to call me back, rather then make me sit on hold listening to your annoying music on a loop? #
  • After sitting on hold for 74 min, here are the ideas I came up with to improve phone based customer service: http://aaron.jorb.in/?p=218 #
  • Eating some fried chicken and hoping the blazers can get themselves back in this game. #100meat #
  • My Friend @andreaarbuckle has some great Debt Zombie Advertisements entered in a contest. Take a look and vote at http://bit.ly/bWezlJ #
  • New on http://aaron.jorb.in : Three Simple Sample #WordPress Shortcodes http://aaron.jorb.in/?p=226 #
  • Damn, moving too slow to get coffee on a day when I could really use it. So Tired I can't even think of a Haiku yet. #
  • Through security with plenty me time to spare. #
  • @fromtherooftops Hurt Locker is one of the best films I saw in the last decade. Feel Better and enjoy. in reply to fromtherooftops #
  • #haikufriday travel edition: Off to see the lady / My wonderful lady out east / Is DC warm yet? #
  • PDX > MCI > BWI #
  • Bus to light rail to plane to plane to bus to train to taxi. All I'm missing on this journey is an air tram, a streetcar, and a boat. #
  • Ray's hell burger. Let's see how good this place is. #100meat #

WordPress Shortcodes: A how to by example

I love the WordPress shortcode api. I’m willing to stand on a roof and scream it. It makes so many aspects of developing a WordPress site so much easier. It allows you to add dynamic information to any post, page, and with a single line text widget. How easy you ask? Let’s look at some examples so I can show you just how easy it is to use.

A shortcode for this year

Sometimes you just want to include the year inline and there’s no reason you should have to change the blog posts every time you want to do it. Here’s a quick shortcode for the year.
[php]function show_current_year(){
return date(‘Y’);
}
add_shortcode(‘show_current_year’, ‘show_current_year’);[/php]
Just that easy. As you can see there are a few components to a basic short code. The first is a function that returns what we want the shortcode to return and the second is a call to add_shortcode with the first parameters being what we want the shortcode to be and the second is the function we want that shortcode to call.

A custom links list shortcode

So that last one was pretty easy. Maybe we should try something a little harder, like adding an unordered list of links that uses each links image. This time we also add an attribute to allow us to limit it to a specific category.
[php]
function show_bookmark_image_list($atts){
extract(shortcode_atts(array(
‘catagory_name’ => false
), $atts));
if ( $catagory_name == false )
$bookmarks = get_bookmarks();
else
$bookmarks = get_bookmarks("catagory_name=$catagory_name");
ob_start();
echo "<ul class=’link-image-list’>";
foreach($bookmarks as $bookmark){
echo "<li><a href=’".esc_url($bookmark->link_url) ."’><img src=’".esc_url($bookmark->link_image)."’ /></a></li>";
}
echo "</ul>";
$list = ob_get_clean();
return $list;
}
add_shortcode(‘show_bookmark_image_list’, ‘show_bookmark_image_list’);
[/php]
This time we added an attribute called Catagegory_name that we can then retrieve using the shortcode_atts function that also allows us to set a default incase no attribute is set. We then go through the list of bookmarks that we retrieve and echo out the results. Since we want our shortcode function to return the data, we wrap our echo is an output buffer. I prefer to use output buffers because it allows me to use echo (and makes the code more readable in my opinion), but you can also use string concoction and return the string if you want.

Most Recent Tweet

This was removed in August 2013 since it relied upon a non deprecated twitter api

Using Shortcodes inside Text/html widgets

Text widgets can be simple and are great for creating small blocks of content that you can place any where your theme allows. This simple hack will allow you to use shortcodes inside your text widgets. Just add the following single line to your theme’s functions.php file.
[php]add_filter(‘widget_text’, ‘do_shortcode’);[/php]
If you want to download and use these three simple shortcodes and enable the use of shortcodes in your text widgets, download this file, remove the .txt at the end of the file, upload it to your plugins folder, and activate the simple shortcodes plugin.

Those three simple sample shortcodes for WordPress should give you a bit of a base to create your own. What are your favorite shortcodes? What’s a shortcode that you wish existed? Comment below and let me know. Also let me know if there is any part of my code that you don’t understand, and I’ll try to help you understand it.

UPDATE

I’ve added two more twitter shortcodes. You can also download all of my shortcodes and follow along to the development of them on google code.

Phone Based Customer Service

At some point, all of us have sat on hold with Customer Service and hated it. In fact, I’ve been on hold for 68 minutes right now. This has given me plenty of time to think of ways companies could improve the phone holding experience.

  1. Offer a no music option when I’m waiting. I’d rather not listen to your annoying music and repeated announcements that my call is important
  2. As every English teacher I ever had was fond of saying: “Show, don’t tell”. Don’t tell me my call is important to you, show me by providing good service when you I finally get a human. Please don’t repeat the same canned announcements over and over.
  3. If you really want me to love your company and yell from the rooftops how amazing you are, offer a hang up and we’ll call you back option.

Those three things would make a world of difference in how I perceive a company. What other ways could phone based customer service be improved? Oh, and I finally got a human at the seventy-four minute mark.