Close

Account

Documentation

Forum

Menu

Reply To: job details page issue

Post count: 67
huwcole
July 9, 2016 at 10:33 am #21119

i fixed the bug with the job categories only displaying one instead of all selected:

original:
<!– category –>
<h5><?php _e(‘Job Category’, ‘jobplanet-themes’); ?></h5>
<p>
<?php
$category = get_the_terms(get_the_ID(), ‘job-category’);
if(!empty($category)) {
echo esc_html($category[0]->name);
} else {
echo esc_html(‘-‘);
}
?>
</p>

replaced with this:

<!– category –>
<h5><?php _e(‘Job Category’, ‘jobplanet-themes’); ?></h5>
<p>
<?php
$catarray = array();
$categories = get_the_terms(get_the_ID(), ‘job-category’);
if(!empty($categories)) {
foreach($categories as $category) {
$catarray[] = $category->name;
}
}
if(!empty($catarray)) {
echo esc_html( implode(‘, ‘, $catarray) );
} else {
echo esc_html(‘–’);
}

?>
</p>

only thing it does not do is to show the primary first…