23 lines
565 B
PHP
23 lines
565 B
PHP
<?php
|
|
/*
|
|
* Given some article data, create a card or thumbnail of the article with the
|
|
* following:
|
|
* - A thumbnail image,
|
|
* - The article heading,
|
|
* - A brief description,
|
|
* - A call to action button.
|
|
*/
|
|
function generate_article_card($data) {
|
|
$article = '
|
|
<div class="box shadow">
|
|
<img class="shadow thumbnail" src="' . $data['thumbnail'] . '">
|
|
<h3 class="card_heading">' . $data['heading'] . '</h3>
|
|
<p class="">' . $data['description'] . '</p>
|
|
<button href="' . $data['path'] . '">Read Article</button>
|
|
</div>
|
|
';
|
|
|
|
return $article;
|
|
}
|
|
?>
|