Skip to content

Instantly share code, notes, and snippets.

@jmdodd
Created January 31, 2012 05:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmdodd/1708947 to your computer and use it in GitHub Desktop.
Save jmdodd/1708947 to your computer and use it in GitHub Desktop.
Display tweets from Ozh' Tweet Archiver using oEmbed
<?php
// You will need to replace the in_category( 'twit' ) conditional with one that fits your own setup.
if ( ! function_exists( 'ucc_twitter_oembed_the_content' ) ) {
function ucc_twitter_oembed_the_content( $content ) {
global $post;
$screen_name = 'YOUR_SCREEN_NAME_HERE';
if ( in_category( 'twit' ) ) {
$tweet_url = "http://twitter.com/#!/{$screen_name}/status/" . get_post_meta( $post->ID, 'ozh_ta_id', true );
$content = "\n[embed]{$tweet_url}[/embed]\n";
}
return $content;
} }
add_filter( 'the_content', 'ucc_twitter_oembed_the_content', 1 );
/*
Copyright 2012 Jennifer M. Dodd (email: jmdodd@gmail.com)
Released under the GPLv2 (or later).
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment