Skip to content

Instantly share code, notes, and snippets.

@PeterBooker
Created August 19, 2013 22:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save PeterBooker/6274957 to your computer and use it in GitHub Desktop.
<?php
/*
* Display BBC News Headlines
*/
function pb_display_news() {
// Get the News data
$headlines = pb_get_news();
?>
<ul class="news-container">
<?php foreach ( $headlines->stories as $headline ) { ?>
<li>
<h3>
<a href="<?php echo $headline->link; ?>" title="<?php echo $headline->title; ?>">
<?php echo $headline->title; ?>
</a>
</h3>
<p>
<img src="<?php echo $headline->thumbnail; ?>" alt="<?php echo $headline->title; ?>" />
<?php echo $headline->description; ?>
</p>
</li>
<?php } ?>
</ul>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment