Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //resorting the "author" name, that is, the Author CPT Post title
- $jjm_name = get_the_title( $p->ID ); // This also works if the "author" is a term.
- if (substr_count($jjm_name, ';', 0, strlen($jjm_name)) == 1) { //is this a semicolon separated name?
- // Generate output
- $artist_name_parts = explode( ';', $jjm_name, 2);
- $output = trim( $artist_name_parts[1] ) . ' ' . trim( $artist_name_parts[0] );
- echo $output;
- } else { //if no semicolon, just output the term name as-is
- echo get_the_title( $p->ID );
- }
Add Comment
Please, Sign In to add comment