Authors List with Specific Post Count
-
I am currently using this to print a list of all authors who have 1 or more posts that are published. But my code fails to output the website, facebook, or twitter information. Can anyone help me figure out what is wrong here?
function contributors() { global $wpdb; $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users WHERE display_name <> 'admin' AND ID <> '57' ORDER BY display_name"); $post_count = get_usernumposts($author->ID); foreach ($authors as $author ) { if (get_usernumposts($author->ID) >= 1){ echo "<li>"; echo get_avatar($author->ID); echo '<div>'; echo "<a class=\"authname\" href=\"".get_bloginfo('url')."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">"; the_author_meta('display_name', $author->ID); echo "</a>"; echo "<br /><div class=\"authdet\">"; if ((get_the_author_meta('user_url', $author->ID) != '') && (get_the_author_meta('twitter', $author->ID) != '') && (get_the_author_meta('facebook', $author->ID) != '')) { echo "<a href=\""; the_author_meta('user_url', $author->ID); echo "\">Website</a>"; echo " | <a href=\""; the_author_meta('twitter', $author->ID); echo "\">Twitter</a>"; echo " | <a href=\""; the_author_meta('facebook', $author->ID); echo "\">Facebook</a><br />"; } elseif ((get_the_author_meta('user_url', $author->ID) != '') && (get_the_author_meta('twitter', $author->ID) != '')) { echo "<a href=\""; the_author_meta('user_url', $author->ID); echo "\">Website</a>"; echo " | <a href=\""; the_author_meta('twitter', $author->ID); echo "\">Twitter</a><br />"; } elseif ((get_the_author_meta('user_url', $author->ID) != '') && (get_the_author_meta('facebook', $author->ID) != '')) { echo "<a href=\""; the_author_meta('user_url', $author->ID); echo "\">Website</a>"; echo " | <a href=\""; the_author_meta('facebook', $author->ID); echo "\">Facebook</a><br />"; } elseif ((get_the_author_meta('twitter', $author->ID) != '') && (get_the_author_meta('facebook', $author->ID) != '')) { echo "<a href=\""; the_author_meta('twitter', $author->ID); echo "\">Twitter</a>"; echo " | <a href=\""; the_author_meta('facebook', $author->ID); echo "\">Facebook</a><br />"; } else { } echo "<a href=\"".get_bloginfo('url')."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">"; the_author_meta('display_name', $author->ID); echo "'s Profile"; echo "</a>"; echo "</div></div>"; echo "</li>"; } } }
The topic ‘Authors List with Specific Post Count’ is closed to new replies.