Title of Main Featured Item
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.
Title of Second Featured Item
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Title of Third Featured Item
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Usage
Featured Items should always appear just under the page title. In the index.php file to include the featured items, include the following code at the top just below the “template” code. (If for some reason the Featured Items are to appear somewhere else on the page besides the top, include the following code at that locaion instead.) Do not nest this inside other HTML “containers” on the page.
<?php
include_once ‘_features.inc.php’;
echo $EQ_FEATURES->toHtml();
?>
In the directory of the index.php file for which you want to include the featured items, create a _features.inc.php file like this:
<?php
if (!isset($TEMPLATE)) {
$TITLE = ‘Featured Items’;
include ‘template.inc.php’;
}
include_once ‘Features.class.php’;
date_default_timezone_set(‘UTC‘);
$EQ_FEATURES = new Features();
$EQ_FEATURES->id = ‘usgs_program_name_section’;
$EQ_FEATURES->title = ‘Featured Items’;
$EQ_FEATURES->author = ‘U.S. Geological Survey’;
$EQ_FEATURES->siteUrl = ‘https://earthquake.usgs.gov/’;
$EQ_FEATURES->baseUrl = ‘’;
$EQ_FEATURES->items[] = array(
‘id’ => ‘item-main’,
‘title’ => ‘Title of Main Featured Item’,
‘content’ => ‘<p>Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>’ .
‘<p>Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore.</p>’,
‘link’ => ‘https://url.of.webpage/’,
‘modified’ => strtotime(‘2014-11-01‘),
‘thumbnail’ => ‘https://placehold.it/75x75’,
‘image’ => ‘https://placehold.it/464x300’
);
$EQ_FEATURES->items[] = array(
‘id’ => ‘item-2’,
‘title’ => ‘Title of Second Featured Item’,
‘content’ => ‘Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.’,
‘link’ => ‘https://url.of.webpage/’,
‘modified’ => strtotime(‘2014-11-01’),
‘thumbnail’ => ‘https://placehold.it/75x75’,
‘image’ => ‘https://placehold.it/75x75’
);
$EQ_FEATURES->items[] = array(
‘id’ => ‘item-3’,
‘title’ => ‘Title of Third Featured Item’,
‘content’ => ‘Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.’,
‘link’ => ‘https://url.of.webpage/’,
‘modified’ => strtotime(‘2014-11-01’),
‘thumbnail’ => ‘https://placehold.it/75x75’,
‘image’ => ‘https://placehold.it/75x75’
);
echo $EQ_FEATURES->toHtml();
?>