$terms = get_the_terms( $post->ID, 'research_type' );
foreach($terms as $term) {
if ($term->slug == "report") {
$type = "report";
$num_reports++;
}
elseif ($term->slug == "publication") {
$type = "publication";
$num_publications++;
}
elseif ($term->slug == "journal-article") {
$type = "journal-article";
$num_articles++;
}
}
$type_display = ucwords(str_replace("-", " ", $type));
$title = get_the_title();
$permalink = get_the_permalink();
$download = get_field('research_upload');
$content = get_the_content();
// create the single result for each result
// vars
$year = get_field('year');
// convert these to get terms
$authors = get_the_terms( $post->ID, 'research_author' );
$prefix = $all_authors = '';
foreach ($authors as $author)
{
$all_authors .= $prefix . $author->name;
$prefix = ', ';
}
$authors = $all_authors;
$interest_areas = get_the_terms( $post->ID, 'research_interest_area' );
$prefix = $all_interest_areas = '';
foreach ($interest_areas as $interest_area)
{
$all_interest_areas .= $prefix . $interest_area->name;
$prefix = ', ';
}
$interest_areas = $all_interest_areas;
$organizations = get_the_terms( $post->ID, 'research_organization' );
$years = get_the_terms( $post->ID, 'grant_year' );
foreach ($years as $y)
{
$year= $y->name;
}
$prefix = $all_organizations = '';
foreach ($organizations as $organization)
{
$all_organizations .= $prefix . $organization->name;
$prefix = ', ';
}
$organizations = $all_organizations;
$segments = get_the_terms( $post->ID, 'research_segment' );
$prefix = $all_segments = '';
foreach ($segments as $segment)
{
$all_segments .= $prefix . $segment->name;
$prefix = ', ';
}
$segments = $all_segments;
$keywords = get_the_terms( $post->ID, 'research_keyword' );
$prefix = $all_keywords = '';
foreach ($keywords as $keyword)
{
$all_keywords .= $prefix . $keyword->name;
$prefix = ', ';
}
$keywords = $all_keywords;
$location = get_field('location');
$image = get_field('image');
$image_url = $image['url'];
/*
// vars
$url = $download['url'];
$id = $download['id'];
$filesize = filesize( get_attached_file( $id ) );
$filesize = size_format($filesize);
$size = $filesize;
}
else {
unset($size);
}*/
if( $download ) {
$url = $download['url'];
$id = $download['id'];
$size = filesize($download['url']);
}
else {
unset($size);
}
?>
Warning: Undefined variable $url in /home/n7514557/public_html/wp-content/themes/hrf/single-research.php on line 147
Warning: Undefined variable $authors in /home/n7514557/public_html/wp-content/themes/hrf/single-research.php on line 155
Warning: Undefined variable $url in /home/n7514557/public_html/wp-content/themes/hrf/single-research.php on line 147
Warning: Undefined variable $authors in /home/n7514557/public_html/wp-content/themes/hrf/single-research.php on line 155