Most recent post is missing from Author page

The mistake is in your first block of code: <?php if (have_posts()): the_post(); ?> <h3> <?php _e(‘All posts by’); ?> <?php echo get_the_author(); ?> <span class=”arrows”>&raquo;</span> </h3> <?php while (have_posts()) : the_post();?> You call the_post() to populate the regular template tags (i.e. get_the_author()) but don’t use the rest of the post. Then, inside your while … Read more

Allow Google crawler to crawl specific Author pages

I would normally ask a couple clarifying questions but I don’t have the reputation to do it so let’s see if I can give you a workable solution. I don’t know what you consider to be high quality but if it is certain fields being complete, you could do an if/else statement around those fields … Read more

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

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