Get only the author profile picture image url inside a loop

Putting the following inside loop should fulfill your needs: <?php $get_author_id = get_the_author_meta(‘ID’); $get_author_gravatar = get_avatar_url($get_author_id, array(‘size’ => 450)); if(has_post_thumbnail()){ the_post_thumbnail(); } else { echo ‘<img src=”‘.$get_author_gravatar.'” alt=”‘.get_the_title().'” />’; } ?>

Show one post per author and limit query to 8 posts

I believe that you can achieve this effect by grouping the query by author ID, which will require a filter(mostly cribbed from the Codex): function my_posts_groupby($groupby) { global $wpdb; $groupby = “{$wpdb->posts}.post_author”; return $groupby; } add_filter( ‘posts_groupby’, ‘my_posts_groupby’ ); If you have less than 8 authors, however, this won’t work. (You will get a number … Read more

Post author is changed to admin after his post is modified by admin

The administrative editors could fix the author manually. Alternatively, you could add custom post meta-data to designate the original author. Then, hooking into the publish_post or transition_post_status actions (or even save_post for that matter) you could check for the presence of the meta-data when a post is being published, and if it exists, replace the … Read more

How to check if commenter is the_author?

Not sure what you are meaning to do but, if you take a look at the get_comment_class() function that is responsible for generating the .bypostauthor class you can see how it determines if the commenter is the author if ( $post = get_post($post_id) ) { if ( $comment->user_id === $post->post_author ) $classes[] = ‘bypostauthor’; } … Read more

Sidebar random author spotlight

You can cut a lot of steps out of this if you use get_users() instead of your custom SQL query. You can then select a random user out of that array using array_rand() (native PHP function, not a wordpress function) and it will return the key you should be using. Here’s an example: $users = … Read more

Completely hide user info

This is dependant on your theme/plugins so it’s impossible to answer, as s_ha_dum mentioned. For example some themes output the author name in the body as a class like <body class=”author-keanu”> or maybe they just use the author id like <body class=”archive author-22″> and then you can check the author by going to www.example.com/?author=22 and … Read more

list author’s posts in author.php

The easiest way would be to simply add: global $query_string; query_posts( $query_string . ‘&posts_per_page=-1’ ); just before your code so you get : <?php global $query_string; query_posts( $query_string . ‘&posts_per_page=-1’ ); while (have_posts()) : the_post(); ?> <li><a href=”https://wordpress.stackexchange.com/questions/71127/<?php the_permalink() ?>”><?php the_title(); ?></a></li> <?php endwhile;?>

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