Skip to content

Instantly share code, notes, and snippets.

@Perun
Created March 26, 2014 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Perun/9776235 to your computer and use it in GitHub Desktop.
Save Perun/9776235 to your computer and use it in GitHub Desktop.
Listet bestimmte Autoren auf einer Unterseite inkl. Profilfoto auf. Siehe http://www.perun.net/2014/03/26/wordpress-autoren-auf-einer-separaten-seite-mit-profilbildern-auflisten/
<?php
function contributors() {
global $wpdb;
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users WHERE display_name != 'Vorname Name' AND display_name != 'Vorname Name2' ORDER BY display_name");
foreach ($authors as $author ) {
echo "<div style=\"float:left; margin: 0 15px 3px 0;\">";
echo get_avatar($author->ID);
echo "</div>";
echo "<div style=\"margin-left: 115px;\">";
echo "<h3>";
echo the_author_meta('display_name', $author->ID);
echo "</h3>";
echo "<p>";
echo the_author_meta('description', $author->ID);
echo "</p>";
echo "<p><a href=\"";
echo get_bloginfo('url');
echo "/author/";
echo the_author_meta('user_nicename', $author->ID);
echo "/\">Blog-Artikel von ";
echo the_author_meta('display_name', $author->ID);
echo "</a></p>";
echo "</div>";
echo "<br style='clear: both;' />";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment