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 = '

' . __( 'By '. $author .' [entry-edit-link before="| "]', hybrid_get_textdomain() ) . '

'; } elseif ( is_page() && $byline_author == 'No' && $byline_date == 'Yes' ) { $byline = '

' . __( 'Posted on [entry-published] [entry-edit-link before="| "]', hybrid_get_textdomain() ) . '

'; } else { $byline = '

' . __( 'By '. $author .' | [entry-published] [entry-edit-link before="| "]', hybrid_get_textdomain() ) . '

'; } return $byline; } add_shortcode( 'coauthor-link', 'news_coauthor_shortcode' ); function news_coauthor_shortcode() { echo ''; if(function_exists('coauthors_posts_links')) coauthors_posts_links(); else the_author_posts_link(); echo ''; }