daily pastebin goal
41%
SHARE
TWEET

alphabetical authors

a guest Feb 1st, 2019 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                                 //resorting the "author" name, that is, the Author CPT Post title
  2.                                 $jjm_name = get_the_title( $p->ID ); // This also works if the "author" is a term.
  3.                                 if (substr_count($jjm_name, ';', 0, strlen($jjm_name)) == 1) { //is this a semicolon separated name?
  4.                                     // Generate output
  5.                                     $artist_name_parts = explode( ';', $jjm_name, 2);
  6.                                     $output = trim( $artist_name_parts[1] ) . ' ' . trim( $artist_name_parts[0] );
  7.                                     echo $output;
  8.                                 } else { //if no semicolon, just output the term name as-is
  9.                                     echo get_the_title( $p->ID );
  10.                                 }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top