function update

This commit is contained in:
magepeopleteam 2022-02-03 10:11:51 +00:00
parent 3a9adf85a9
commit fe8d7511d0
2 changed files with 21 additions and 0 deletions

View File

@ -10,7 +10,9 @@ if (!function_exists('mep_ev_org')) {
global $post, $author_terms;
ob_start();
if ($author_terms) {
$org = get_the_terms(get_the_id(), 'mep_org');
require(mep_template_file_path('single/organizer.php'));
}
$content = ob_get_clean();
echo apply_filters('mage_event_single_org_name', $content, $post->ID);

View File

@ -1,6 +1,25 @@
<p>
<?php echo mep_get_option('mep_by_text', 'label_setting_sec') ? mep_get_option('mep_by_text', 'label_setting_sec') : esc_html__('By:','mage-eventpress'); ?>
<?php
$count_term = sizeof($org);
$count = 1;
if( $count_term > 1){
foreach ($org as $_org) {
?>
<a href="<?php echo get_term_link( $_org->term_id, 'mep_org' ); ?>">
<?php echo esc_html($_org->name); if($count_term == $count){
}else{
echo ', ';
} ?>
</a><?php
$count++;
}
}else{
?>
<a href="<?php echo get_term_link( $author_terms[0]->term_id, 'mep_org' ); ?>">
<?php echo esc_html($author_terms[0]->name); ?>
</a>
<?php } ?>
</p>