shortcode help require
Here you go: add_shortcode(‘latest_tweets’, ‘latest_tweets’); function latest_tweets($atts){ extract(shortcode_atts(array( ‘max’ => 5 ), $atts)); $twitter_id = esc_attr(strip_tags($atts[0])); // try to get data from cache to avoid slow page loading or twitter blocking if (false === ($output = get_transient(“latest_tweets_{$twitter_id}”))): $doc = new DOMDocument(); $feed = “http://twitter.com/statuses/user_timeline/{$twitter_id}.rss”; $doc->load($feed); $output = “<ul>”; $i = 1; foreach ($doc->getElementsByTagName(‘item’) as $node) … Read more