How we can get the author ID by its Name

get_user_by will get you the user data by ‘id’, ‘slug’, ’email’, or ‘login’. ‘slug’ is the user_nicename. $user = get_user_by(‘slug’,’nicename’); However, I am not sure what you mean by ‘name’. There are other plausible ‘name’ fields, not all of them required. There is the display_name for example. To search fields like user_nicename you will need … Read more

List authors of site with link and gravatar

To answer your problems: Sorting by post count You can collect all the information you need in to an array and sort that array by number of posts , like this: //function to sort array by filed function authors_orderBy($data, $field){ $code = “if (\$a[‘$field’] == \$b[‘$field’]) {return 0;} return (\$a[‘$field’] < \$b[‘$field’]) ? 1 : … Read more

More posts from the current author

This will retrieve the posts of current author when used in the loop. Put the following in your theme functions.php: function my_get_display_author_posts() { global $authordata, $post; $authors_posts = get_posts( array( ‘author’ => $authordata->ID, ‘post__not_in’ => array( $post->ID ) ) ); $output=”<ul>”; foreach ( $authors_posts as $authors_post ) { $output .= ‘<li><a href=”‘ . get_permalink( $authors_post->ID … Read more

No authors in change author dropdown

The role “Reviewer” only has special capabilities, no other capabilities. To get into the author list you have to be at least a contributor or author. function rb_addroles() { $role = get_role(‘contributor’); remove_role( ‘reviewer’ ); add_role( ‘reviewer’, ‘Reviewer’, $role->capabilities ); $reviewer = get_role(‘reviewer’); $reviewer->add_cap( ‘edit_review’ ); $reviewer->add_cap( ‘read_review’ ); $reviewer->add_cap( ‘delete_review’ ); } add_action( ‘admin_init’, … Read more

Show Author in custom rss feed

Try it: <?php echo get_the_author_meta( ‘display_name’, $post->post_author ); ?> You can use the_author function in wordpress standard loop, Not foreach. to set global author information you should use the_post function. but in foreach, you can use get_the_author_meta instead of the_author to pass author id $post->post_author.

What’s a good way to put authors into groups

To do this literally (put authors into groups) best way would probably be to create custom taxonomy for users. See custom user taxonomies in WordPress for reference. However the end result you are looking for does not really deal with grouping users – it deals with grouping posts. Registering custom taxonomy (“company”) for posts would … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)