Want more features on Pastebin? Sign Up, it's FREE!
Guest

WP Author Short Code

By: a guest on Sep 26th, 2010  |  syntax: PHP  |  size: 0.50 KB  |  views: 262  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /* Start Get Author Link */
  2. function my_authors_meta($atts){
  3.         /* If the user passed an integer then good to go */
  4.         if (is_numeric($atts[0])) {
  5.                 $authorid = $atts[0];
  6.                 echo '<a href="';
  7.                 echo get_bloginfo('url');
  8.                 echo '/author/';
  9.                 echo the_author_meta('user_nicename', $authorid );
  10.                 echo '/">';
  11.                 echo the_author_meta('display_name', $authorid );
  12.         echo '</a>';
  13.         }
  14. }
  15. add_shortcode('author', 'my_authors_meta');
  16. add_filter('my_authors_meta', 'do_shortcode');
  17. /* Start Get Author Link call [author id] */
clone this paste RAW Paste Data