Using WordPress Post Formats as a Taxonomy

Filed in Web DevelopmentTags: Post Formats, Themes, WordPress

One of the great new features in the soon-to-be-released WordPress 3.1 is Post Formats. This feature enables posts to be classified as one of the following "types": standard (default), aside, audio, chat, gallery, link, quotestatus, or video. As described in the WordPress Codex:

A Post Format is a piece of meta information that can be used by a theme to customize its presentation of a post. The Post Formats feature provides a standardized list of formats that are available to all themes that support the feature... In short, with a theme that supports Post Formats, a blogger can change how each post looks by choosing a Post Format from a radio-button list.

Clearly, the most obvious use of Post Formats will be to customize the layout or style of a post based on the selected Post Format type. While this use will be incredibly beneficial, it does not fully describe the power or functionality of the Post Formats feature.

To give just one example, the Post Formats feature includes its own taxonomy (similar to Categories or Tags). Having their own taxonomy means that posts can be displayed by Post Format type.  Compare:

Category taxonomy:
mysite.com/category/foo-bar
Tag taxonomy:
mysite.com/tag/foo-bar
Post Format taxonomy:
mysite.com/type/foo-bar

Consider the potential of this taxonomy. Want to add podcasting to your site? Assign all of your podcast posts the audio Post Format type, and your podcasting section becomes mysite.com/type/audio. Want to add a photo gallery section to your site? Assign your gallery posts to the gallery Post Format type. Photoblogging? Use the image Post Format type. Videoblogging? Use the video Post Format type.

Implementing Post Format Taxonomy in Themes

Making use of the Post Format taxonomy in Themes is incredibly easy, thanks to a few functions:

  • get_post_format() - return the Post Format slug, e.g. 'aside'.
  • get_post_format_string( $post-format ) - return the Post Format string, e.g. 'Aside'.
  • get_post_format_link( $post-format ) - return the URL to the Post Format archive page, e.g. mysite.com/type/aside

Breadcrumb Navigation

For example, I have added the Post Format taxonomy to the breadcrumb navigation in my Oenology Theme:

Post Format Breadcrumb Navigation

Post Format Breadcrumb Navigation

This breadcrumb is accomplished simply by using:

get_post_format_string( get_post_format() )

(Note: the output is a string, to which I appended a 's' to the end, because I think "Post Format: Images" is more intuitive than "Post Format: Image" in this context.)

Taxonomy Archive Links

As another example, I have added links to the Post Format taxonomy archive:

Post Format Link

Post Format Link

This link is accomplished using the following code:

'<a href="' . get_post_format_link( get_post_format() ) . '">' . get_post_format_string( get_post_format() ) . '</a>'

Taxonomy Sidebar Widget

How about adding a Widget that outputs a list of Post Format types, to complement the Category and Tag Widgets? Here's a rough proof-of-concept:

Post Formats Sidebar Widget

Post Formats Sidebar Widget

The code for this is a bit more convoluted, but here are the important bits:

<ul class="leftcolcatlist">
<?php
$postformatrssimg = "/images/rss.png";
$postformatrssurl = get_template_directory_uri() . $postformatrssimg;
$postformatterms = get_terms( 'post_format' );
foreach( $postformatterms as $term ) {
$termslug = substr( $term->slug, 12 );
$termname = $term->name;
$termlink = get_post_format_link( $termslug );
$termcount = $term->count;
$postformatlist = '<li><a title="Subscribe to the '. $termname .' news feed" href="' . home_url() . '/type/' . $termslug .'/feed/"><img src="'.$postformatrssurl.'" alt="feed" /></a><a href="'. $termlink .'">' . $termname . '</a> (' . $termcount . ')</li>';
echo $postformatlist;
}
?>
</ul>

What else? Well,  what about adding Post Format taxonomy to a menu?

Just remember: with Post Formats, think outside the box of Post layout and style, and consider what else you can do with this great new feature!

I've added a proof-of-concept example of a Post Format sidebar Widget, complete with taxonomy archive link, feed link, and count

Twitter Updates for 2011-01-11

Filed in Lifestream

Twitter Updates for 2011-01-10

Filed in Lifestream

Twitter Updates for 2011-01-09

Filed in Lifestream
  • @davecoveney that is patently untrue. From the moment of conception, a new life exists, by every accepted definition of "life" (cont.) in reply to davecoveney #
  • @davecoveney primary evidence is self-directed growth. Even a blastocyst uses its own genetic information to replicate/differentiate cells in reply to davecoveney #
  • @davecoveney there is no "potential life"; there is only life. The only valid demarcation point is conception. Thus, contraception != sin in reply to davecoveney #
  • @davecoveney the key question, then, is "when does life begin"? At that point (and not before), the choice of the independent life matters. in reply to davecoveney #
  • @markjaquith that's SO much better than the WP kitteh! in reply to markjaquith #
  • @WordPressTV any idea why I am unable to oEmbed wordpress.tv videos? Are oEmbed-compatible (i.e. vidpress) videos tagged as such? #
  • @davecoveney I appreciate that, but existence of unique life at conception is biological fact, not "belief". ("Personhood" may be, though.) in reply to davecoveney #
  • @CrizzleColts what's that in response to? The 4th and goal from the 1 question on @18to88? If so: sad, but unfortunately true. in reply to CrizzleColts #
  • @nathanrice I assume you're talking about the psycho who shot Rep. Giffords? I assume the knee-jerk reaction was shooter was rightwinger? in reply to nathanrice #
  • Let's be clear: the guy who shot Rep. Giffords was first and foremost a psychotic nutcase. But he was NOT a rightwinger. #
  • @nathanrice absolutely. Now is the time to pray for recovery of victims, not to knee-jerk react. The full truth will come out in due time. in reply to nathanrice #
  • @LovinBlue no problem. Just trying to fend off the anticipated knee-jerk reaction. There will be plenty of time for that later. in reply to LovinBlue #
  • The Saints are the MUCH better team, but boy, are they playing stupidly so far. #
  • Riddle me this: #Colts place Hayden on IR; we're short a DB. So we sign a practice squad OT?!? I sure hope DBs Hamlin & Richardson can ball #
  • In case you don't believe Jared Loughner is merely a psychotic nutcase, I present Exhibit A: his YouTube manifesto http://bit.ly/dNpgl2 #
  • Former #Colts player Raheem Brock just sacked Drew Brees. Get you some, @RaheemBrock! #
  • Go Brandon Stokley!!!! #
  • Jared Loughner: Raving Lunatic - http://bit.ly/ifXdRh #
  • @_bexology why not? Have you read what he wrote in his videos? "Anarchist" sounds rather apropos to me. in reply to _bexology #
  • @NuclearMoose indeed. But my main point is that he's first-and-foremost mentally disturbed, not Conservative/Liberal ideologue. in reply to NuclearMoose #
  • FINALLY! An intentional grounding actually called for the QB being in the pocket and not getting the ball past the line of scrimmage. #
  • Waters just PUNCHED the punt returner when he was on the ground. Are the Saints really this dirty? #
  • @alistairjhogg perhaps, but it was a *punch*, with the returner already on the ground, on his back. Play was dead. Dirty move. in reply to alistairjhogg #
  • @_bexology wow. history proves you horribly wrong. Violence is inherent in left-wing anarchy. See e.g. Saul Alinsky, Bill Ayers. in reply to _bexology #
  • @carlhancock me too in reply to carlhancock #
  • @alistairjhogg that was an Epic Fail on fourth and inches, eh? in reply to alistairjhogg #
  • @_bexology no, they want chaos, accomplished through violence in reply to _bexology #
  • @_bexology maybe the Bill Ayers of today, but not the Bill Ayers of domestic terrorism. in reply to _bexology #
  • Now THAT is a crap call. How do you not flag the Saints player who cheap-shotted 91 of the Seahawks. That's ridiculous. #
  • @NuclearMoose @lorelleonwp Sarah Palin had nothing to do with Jared Loughner's beliefs, decisions, or acts. in reply to NuclearMoose #
  • @williamsba yeah, until the fourth quarter :/ in reply to williamsba #
  • @Skitzzo @dozba but that doesn't fit the narrative of a flag-burning, commie-manifest-reading Palin-ite tea-partier. in reply to Skitzzo #
  • Should have picked that pass. #
  • Almost forced a fumble there, but a third-down stop works just fine for me! Go #Colts #
  • @18to88 it hit the goal line, which I assume after being touched by a player from the kicking team is automatically dead, as a touchback? in reply to 18to88 #
  • Run past the sticks, White! #
  • Welcome back, Dan Muir!!!! #
  • @18to88 I disagree. White catches that ball if it's on-target. But, I'd rather it be off-target than picked off. in reply to 18to88 #
  • @JMV1070 with the jumbo package, no less... in reply to JMV1070 #
  • Why not go for it there? You're already deeper than your last for punts left you. #
  • @LovinBlue I thought the same thing. in reply to LovinBlue #
  • That was a MASSIVE HOLD on Freeney on that RB dump-off. #
  • Thanks, Sanchez! We like 3rd and 12 better than 3rd and 7! #
  • @CrizzleColts @18to88 is that even called anymore? in reply to CrizzleColts #
  • Nice block by Wayne there, and White dives for the first down. #
  • There's Good Pierre!!!!!!!!!!!!!! 57-yd DB-burning TOUCHDOWN!!!!!!! Go #Colts 7-0 #
  • @18to88 did I see an uncalled block in the back that let the returner get back to the 20? Should have made him pay for running it out there in reply to 18to88 #
  • Sanders or Bullitt would have picked off that pass. #
  • Tryon with the first-half back-breaking INT! C'mon Manning. 45 seconds left. Sure wish we had all 3 timeouts left... #
  • @XL950 Maybe you couldn't pick Sanchez, but Tryon sure can! in reply to XL950 #
  • @LovinBlue or, take a sack... :/ in reply to LovinBlue #
  • @LovinBlue not worth the risk. We have more turnovers coming off of Sanchez yet tonight. in reply to LovinBlue #
  • @Shake1n1bake so who steps in as fifth-string Safety? Hamlin? in reply to Shake1n1bake #
  • @LovinBlue he tried to punch the ball out instead of wrapping him up. in reply to LovinBlue #
  • @CrizzleColts @18to88 just as long as the 3rd quarter OFFENSE shows up... in reply to CrizzleColts #
  • Saturday with a HUGE block on that first-down run play. #
  • Adam Vinatieri: right down the middle; nothing but net! #Colts lead 10-7. #
  • Cornelius Brown with the best Special-Teams play of the game (so far)! #
  • Angerer!!!!! What a TFL there! #
  • Hey, uh, can we spy the RB out of the backfield sometime tonight, maybe? #
  • Dom was NOT going to be denied on that third-down run! #
  • So, Cromartie can just trip Garcon? No flag? #
  • Contact was early. Should have been DPI. #
  • @toddsmith30 replay came after I tweeted in reply to toddsmith30 #
  • Here comes AV. We needed 7 here. #
  • @toddsmith30 don't know. I'm watching this one from St. Louis 🙁 in reply to toddsmith30 #
  • Taj Smith should have been nowhere near there, but the kicker flopped a LOT #
  • DON'T RUN INTO THE KICKER THIS TIME! (And thank you, Sanchez, for your inaccuracy.) #
  • @LovinBlue you know, I'm not? Merely *playing* this game is a bonus. That said: let's go get this win! in reply to LovinBlue #
  • Adam Vinatieri is MONEY from 50 yards!!!!!!!!!!!!!!!!!!! #Colts lead 16-14! 0:57 remaining. #
  • Chris Collinsworth is a freaking moron. That is an incomplete pass. #
  • And THERE is the crap officiating call I've been waiting for all night... #
  • Manning had a 108.7. But somehow, this loss was his fault, and the Jets beat "Manning". #
  • @Skitzzo @justintadlock he was going to ground *during* the catch. By definition & by rule he must maintain possession all the way to ground in reply to Skitzzo #
  • @18to88 special teams and lack of talent in defensive secondary cost us this game; nothing more. If that KR goes to 26, not 46, we win. in reply to 18to88 #
  • @Shake1n1bake yep; exactly what you said. in reply to Shake1n1bake #
  • @18to88 of course, you said it just before I did... in reply to 18to88 #
  • @BlueMark18 @18to88 Taj Smith didn't end up hurting us. in reply to BlueMark18 #
  • @BlueMark18 yeah, he should have caught that. But, if DPI is called on the throw to Tamme, we probably score a TD, too. in reply to BlueMark18 #
  • @BlueMark18 @18to88 I agree & I'm glad. @TajSW10 has a great story, & I'm happy for him (& the Jets punter will soon get an Oscar nod) in reply to BlueMark18 #

Jared Loughner: Raving Lunatic

Filed in PoliticsTags: Democrats, Media Bias, Republicans, War on Terror

I present, in all its dubious glory, the text contained in a video, written by Jared Loughner, the alleged gunman who shot U.S. Representative Gabrielle Giffords (D-AZ), wounding her and others, and killing at least 5.

The slideshow-format video is titled Introduction: Jared Loughner. The text follows (transcribed as accurately as possible; "---" indicates a new slide):

My Final Thoughts: Jared Lee Loughner!

---

Most people, who read this text, forget in the next 2 second!

---

The population of dreamers in the United States is less than 5%!

---

If 987,123,478,961,876,341,234,671,234,098,601,978,618 is the year in B.C.E. then then the previous year of 987,123,478,961,876,341,234,671,234,098,601,978,618 is 987,123,478,961,876,341,234,671,234,098,601,978,619 B.C.E.

987,123,478,961,876,341,234,671,234,098,601,978,618 is the year in B.C.E.

Therefore, the previous year of 987,123,478,961,876,341,234,671,234,098,601,978,618 is 987,123,478,961,876,341,234,671,234,098,601,978,619 B.C.E.

If B.C.E. years are unable to start, then A.D.E. years are unable to begin.

B.C.E. years are unable to begin.

Thus, A.D.E. years are unable to begin.

---

If A.D.E. is endless in year then the years in A.D.E. don't cease.

A.D.E. is endless in year.

Therefore, the years in A.D.E. don't cease.

---

If I teach a mentally capable 8 year old for 20 consecutive minutes to replace an alphabet letter with a new letter and pronunciation then the mentally capable 8 year old writes and pronounces the new letter and pronunciation that's replacing an alphabet letter in 20 consecutive minutes.

I teach a mentally capable 8 year old for 20 consecutive minutes to replace an alphabet letter with a new letter and pronunciation.

Thus, the mentally capable 8 year old writes and pronounces the new letter and pronunciation that replaces an alphabet letter in 20 consecutive minutes.

---

Every human who's mentally capable is always able to be treasurer of their new currency.

---

If you create one new currency then you're able to create a second new currency.

If you're able to create a second new currency then you're able to create a third new currency.

You create one new currency.

Thus, you're able to create a third currency.

---

You're a treasurer for a new currency, listener?

You create and distribute your new currency, listener?

Don't allow the government to control your grammar structure, listener?

---

If you create one new language then you're able to create a second new language.

If you're able to create a second new language then you're able to create a third new language.

You create one new language.

Thus, you're able to create a third language.

---

All humans are in need of sleep.

Jared Loughner is a human.

Hence, Jared Loughner is in need of sleep.

---

Sleepwalking

If I define sleepwalking then is the act or state of walking, eating, or performing other motor acts while asleep, of which one is unaware upon awakening.

I define sleepwalking.

Thus, sleepwalking is the act or state of walking, eating, or performing other motor acts while asleep, of which one is unaware upon awakening.

I am a sleepwalker - who turns off the alarm clock.

---

All conscience dreaming at this moment is asleep.

Jared Loughner is conscience dreaming at this moment.

Thus, Jared Loughner is asleep.

---

Terrorist

If I define terrorist then a terrorist is a person who employs terror or terrorism, especially as a political weapon.

I define terrorst.

Thus, a terrorist is a person who employs terror or terrorism, especially as a political weapon.

If you call me a terrorist then the argument to call me a terrorist is Ad Hominem.
You call me a terrorist.
Thus the argument to call me a terrorist is Ad Hominem.

---

Every United States Military recruit at MEPS in Phoenix is receiving one mini bible before the tests.

Jared Loughner is a United States Military recruit at MEPS in Phoenix.

Therefore, Jared Loughner is receiving one mini bible before the tests.

I didn't write a belief on my Army application, and the recruiter wrote on the application: None.

---

The majority of citizens in the United States of America have never read the United States of America's Constitution.

You don't have to accept the federalist laws.

Nonetheless, read the United States of America's Constitution to apprehend all of the current treasonous laws.

You're literate, listener?

---

If the property owners and government officials are no longer in ownership of their land and laws from a revolution then the revolutionary's from the revolution are in control of the land and laws.

The property owners and government officials are no longer in ownership of their land and laws from a revolution.

Thus, the revolutionary's from the revolution are in control of the land and laws.

---

In conclusion, reading the second United States Constitution, I can't trust the current government because of the ratifications; The government is implying mind control and brainwash on the people by controlling grammar.

No! I won't pay debt with a currency that's not backed by gold and silver!

No! I won't trust in God!

---

What's government if words don't have meaning?

Assuming the video stays online, you can watch below:

Sadly, Loughner has published a total of 5 such psychotic videos.

This man is a highly disturbed, psychotic lunatic. Please, don't fall prey to the knee-jerk reaction from the Left that he is a "rightwinger" or part of the TEA party.

If anything, he leaned to the left, rather than to the right. The guy enjoyed watching the US Flag being burned, and listed Mein Kampf and the Communist Manifesto among his favorite books.

But most importantly, his psychosis likely transcends the liberal-conservative spectrum.

Twitter Updates for 2011-01-08

Filed in Lifestream

Twitter Updates for 2011-01-07

Filed in Lifestream

Twitter Updates for 2011-01-06

Filed in Lifestream

Twitter Updates for 2011-01-05

Filed in Lifestream

Twitter Updates for 2011-01-04

Filed in Lifestream