Created
January 31, 2012 05:05
-
-
Save jmdodd/1708947 to your computer and use it in GitHub Desktop.
Display tweets from Ozh' Tweet Archiver using oEmbed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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