function news_byline( $byline ) { global $post; $user_id = $post->post_author; $byline_author = get_post_meta($post->ID, 'byline-author', true); $byline_date = get_post_meta($post->ID, 'byline-date', true); if ( function_exists( 'get_cimyFieldValue' ) ) { if ( get_cimyFieldValue( $user_id, 'UNIT' ) ){ $unit = get_cimyFieldValue( $user_id, 'UNIT' ); } } $user_info = get_userdata($user_id); if ( !empty( $user_info->user_email ) ) { if ( function_exists( 'CoAuthorsIterator' ) ) { $i = new CoAuthorsIterator(); $i->iterate(); } if ( function_exists( 'get_cimyFieldValue' ) ) { $author = ''. get_the_author_meta( 'display_name' ) .', '. get_cimyFieldValue( get_the_author_ID(), 'UNIT' ); } else { $author = ''. get_the_author_meta( 'display_name' ) .''; } if ( function_exists( 'CoAuthorsIterator' ) ) { while($i->iterate()){ $author .= ', and '. get_the_author_meta( 'display_name' ) .', '. get_cimyFieldValue( get_the_author_ID(), 'UNIT' ); } } } else { $author = '[entry-author]'; } if ( is_page() && $byline_author == 'No' && $byline_date == 'No' ) { $byline = ''; } elseif ( is_page() && $byline_author == 'Yes' && $byline_date == 'No' ) { $byline = '
'; } elseif ( is_page() && $byline_author == 'No' && $byline_date == 'Yes' ) { $byline = ' '; } else { $byline = ' '; } return $byline; } add_shortcode( 'coauthor-link', 'news_coauthor_shortcode' ); function news_coauthor_shortcode() { echo ' '; }