Skip to content

Instantly share code, notes, and snippets.

@bmoredrew
Created September 22, 2015 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmoredrew/8b568e39826f719cc4fb to your computer and use it in GitHub Desktop.
Save bmoredrew/8b568e39826f719cc4fb to your computer and use it in GitHub Desktop.
transient api to cache xml data ?
$feed = simplexml_load_file( 'URL' );
foreach ( $feed->channel->item as $item )
{
if( $counter <= $limit )
{
echo '<p>' . esc_html( $item->title ) . '</p>';
echo '<a href="' . esc_attr( $item->link ) . '">Read more &gt;</a>';
$counter++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment