Hi- in the Featured section, I want to add the Country value after the Description snippet, but the code I added to the ItemFunctions is producing errors. I'm still learning php and will appreciate any help to spot the problem.
function display_random_featured_item($withImage=false)
{
$featuredItem = random_featured_item($withImage);
$html = '<h2>Featured Item</h2>';
if ($featuredItem) {
$itemTitle = item('Dublin Core', 'Title', array(), $featuredItem);
$html .= '<h3>' . link_to_item($itemTitle, array(), 'show', $featuredItem) . '</h3>';
if (item_has_thumbnail($featuredItem)) {
$html .= link_to_item(item_square_thumbnail(array(), 0, $featuredItem), array('class'=>'image'), 'show', $featuredItem);
}
// Grab the 1st Dublin Core description field (first 150 characters)
if ($itemDescription = item('Dublin Core', 'Description', array('snippet'=>150), $featuredItem)) {
$html .= '<p class="item-description">' . $itemDescription . '</p>';
}
// Grab the Dublin Core Country field
if ($itemCountry = item('Dublin Core', 'Country', array(), $featuredItem)) {
$html .= '<p class="item-country">' . $itemCountry . '</p>';
}
} else {
$html .= '<p>No featured items are available.</p>';
}
return $html;
}