Freedom
Vi vs. Emac. The epic battle
by tw2113 on Aug.03, 2010, under Freedom, Passions
Vi(m)
or
Emac?

Do You Think You Know Alex Cook?
by tw2113 on Jul.08, 2010, under Creativity, Freedom, Web Design-Development
With all due respect to both past and future interviews, I consider this one to be my most important. With this interview, I am holding up a mirror to your pasts. When you look into this mirror, you do not see yourself, you see Alex Cook. “What do you mean” you say? Alex is fresh out of University, and at the start of her path to her career.
Dear Planet Fedora
by tw2113 on Jun.20, 2010, under Freedom
Just a Droid test post
by tw2113 on Jun.18, 2010, under Adventures, Freedom
Just a simple twitter/identica shortcode
by tw2113 on Apr.22, 2010, under Freedom, Ideas, Passions
I realized that I will likely reference many twitter people in posts and I think it is common courtesy to link to their profile so that you can go check them out if you want. However, I also want to be lazy and not have to type out their full twitter url all the time. Thus I decided that a shortcode would be nice and efficient.
With the following code,
<?php
function twitter_shortcode( $atts, $content = null ) {
return '<a href="http://twitter.com/' . $content . '" title="' . $content . '\'s Twitter Profile">' . $content . '</a>';
}
add_shortcode('twitter', 'twitter_shortcode');
?>
I can wrap a username in [twitter] [/twitter] and have it output the full link, like this (Twitter)
Edit
I have since realized that this is perfectly capable of working with identi.ca as well. For wordpress users of Identi.ca, copy/paste the following code into your functions.php file. It will work the exact same way regarding wrapping the user ID
<?php
function identica_shortcode( $atts, $content = null ) {
return '<a href="http://identi.ca/' . $content . '" title="' . $content . '\'s Identi.ca Profile">' . $content . '</a>';
}
add_shortcode('identica', 'identica_shortcode');
?>
Like so: (Identi.ca)











Recent Comments