Is author.php a core file?

If you are talking about author.php in your theme directory, usually at wp-content/themes/<YOURTHEMENAME> this isn’t a core file but part of your theme. Themes don’t get changed when WordPress is updated, so concerning WordPress updates themes are safe. But if your theme isn’t custom made by you (which I assume here) this file would be … Read more

Authors & profiles (and exclude ID’s)

First, let me say that it is not “Strangely” working using ‘subscribers’ role. Note that you are taking out the ‘subscriber’ role from the results. The correct way to get only authors and exclude some IDs is using the role and exclude arguments of get_users() function: <?php $args = array( ‘role’ => ‘author’, //authors with … Read more

Author list based on recently active

I would take a different approach to this using a direct database query to get a list of author IDs ordered by recent posts. global $wpdb; $user_ids = $wpdb->get_results( ” SELECT DISTINCT post_author FROM $wpdb->posts ORDER BY post_date DESC ” ); if ( $user_ids ) { foreach ( $user_ids as $user_id ) { $user = … Read more

Display author name, outside the loop, if they haven’t published a custom post

author’s name or logged in user’s name? can use global $current_user; or wp_get_current_user(); if the user is logged in. if( is_user_logged_in() ) { $current_user = wp_get_current_user(); echo $current_user->user_firstname; } for specific user role you can check $current_user->roles array. Reference: https://codex.wordpress.org/Function_Reference/wp_get_current_user https://codex.wordpress.org/Function_Reference/get_currentuserinfo

Breadcrumbs – get the author?

Call echo $GLOBALS[‘wp_query’]->query_vars[‘author_name’]; and it should show you the author. You can also echo $GLOBALS[‘wp_query’]->post->post_author; or echo $GLOBALS[‘wp_query’]->queried_object->post_author;. hope i didn’t mix up with arrays and objects.

How to get all possible arguments for a wordpress function

I think you are confusing function arguments with author (user) meta fields. To get all user meta fields you can use get_user_meta() with empty $key parameter. For example, for user with ID 45: $user_meta = get_user_meta( 45 ); $user_meta will be an array with all meta fields for the user with ID = 45.

Get avatar of the logged-in user in WordPress

All you need to do is pass the current users email address into the get_avatar() function. <?php $current_user = wp_get_current_user(); if ( ($current_user instanceof WP_User) ) { echo get_avatar( $current_user->user_email, 32 ); } ?> Here are some links for specifics: get_avatar(); wp_get_current_user(); A response to your new problem in the comments below: <?php echo ‘<img … Read more

Display only author posts in dashboard all posts panel

The following worked for me to show only the current user’s posts in the admin add_action( ‘load-edit.php’, ‘posts_for_current_author’ ); function posts_for_current_author() { global $user_ID; /*if current user is an ‘administrator’ do nothing*/ //if ( current_user_can( ‘add_users’ ) ) return; /*if current user is an ‘administrator’ or ‘editor’ do nothing*/ if ( current_user_can( ‘edit_others_pages’ ) ) … Read more